Subject IB Connection
Author Shimon Salzman
Hello One and All,

I am new to Delphi, Interbase and IBObjects though I am not new to
programming or dbs. I have downloaded the evaluation of IBObjects and am
attempting to get a feel for the tools and processes. However, I am having
difficulty just getting started. Below is a simple program I wrote to check
to see if a database file exist and to connect to it. Guardian is running.
When I run the program I learn the file does exist however I am unable to
connect to the database. I would like to know what I am missing!

thank you for your assistance
John Salzman

The form contains 2 buttons. Click 1 to check to see if the file exist.
Click the other to connect to the database. There are two labels and a
TIB_Connection.

The following are properties for the the TIB_Connection:
DatabaseName = D:\InterBase\examples\database\Employee.gdb
LoginPrompt = True
Name = IB_Connection1
Password = masterkey
Path = D:\InterBase\examples\database\Employee.gdb
SysDBA = SYSDBA
Username = SYSDBA

This is the code I am using:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
IB_Components, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
IB_Connection1: TIB_Connection;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
if FileExists(IB_Connection1.Path)
then
label1.Caption := 'File Exist'
else
label1.Caption := 'No File';
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if IB_Connection1.Connected
then
label2.Caption := 'Connected'
else
label2.Caption := 'Not Connected';


end;

end.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com