Sent: Friday, June 22, 2001 9:41 PM
Subject: RE: [DUG]: Connecting to
Interbase
Hi
Mark,
The
DatabaseName property is kinda like an alias for your app, not the actual
gdb name so it usually has my Application name as it's
value.
If
you double click on the TDatabase component in the designer you get a
popup window where you can set parameters. I set Server Name etc in
here
an
example of one of mine (Parameter Overrides that is) is...
SERVER NAME=C:\ibdata\equis\data\equis.gdb
;SERVER
NAME=
USER NAME=SYSDBA
;PASSWORD=
PASSWORD=MASTERKEY
OPEN
MODE=READ/WRITE
SCHEMA CACHE
SIZE=8
LANGDRIVER=
SQLQRYMODE=
SQLPASSTHRU MODE=SHARED
AUTOCOMMIT
SCHEMA CACHE TIME=-1
MAX ROWS=-1
BATCH COUNT=200
ENABLE
SCHEMA CACHE=FALSE
SCHEMA CACHE DIR=
ENABLE BCD=TRUE
BLOBS TO
CACHE=64
BLOB SIZE=32
I
leave a commented out "blank Server Name" and "Password" (this is the
Interbase password option) there for creating deployable builds (these values
are assigned at run-time and typically held in an ini file (pasword is of
course stored encrypted in the ini file). I probably should achieve this
via compiler directives or something but for now it works - I just have to
remeber to use the blanked options for the actual build.
When
you use say a TQuery component on a form that has access to the form with the
TDatabase component you will see your DatabaseName appear as one of the
options in the TQuery's database property in the object
inspector.
Hope
yopu can follow this - if you need more examples or info then email me
directly
regards
Willie
This is where I started a couple of days ago (without
success)
I put a TDatabase on the form, IBDatabase.
I set it's DatabaseName property to
'D:\IBTEST\IB\MyDB.GDB'
I set the DriverName to INTRBASE
I set the Connected property to True and get "Inavlid
Parameter"
I set Params SERVER NAME='D:\IBTEST\IB\MyDB.GDB', try
again with same result
What other Param do I need to set?
TIA
Mark
----- Original Message -----
Sent: Thursday, June 21, 2001 11:20
PM
Subject: RE: [DUG]: Connecting to
Interbase
Alternatively .....
you could use a TDatabase component of
the Data Access components tab - the Database Name (i.e. the GDB file name
and path) can be set at run time (and design time by double clicking and
entereing the session parameters) as can login name and
password.
This uses the BDE but doesn't require an
alias.
Or have I misunderstood the
question?
Hi Mark,
Yes this is correct when using the
BDE. (as far as I know) Interbase must be connected by an
Alias. You could use the IB components and then you can specify a
filename to open.
Alternatively you could create dialog that
creates a temp alias in the BDE which points to the Interbase db
selected.
var
MyList: TStringList;
begin
MyList := TStringList.Create;
try
with
MyList do
begin
Add('SERVER
NAME=IB_SERVER:/PATH/DATABASE.GDB');
Add('USER NAME=MYNAME');
end;
Session1.AddAlias('NewIBAlias', 'INTRBASE',
MyList);
finally
MyList.Free;
end;
end;
Thanks,
David Smith.
Hi
With my Paradox database I could just use an
OpenFileDialog to point to a file in the Database directory to set
this before opening tables. ie I did not have to have an Alias
set up in the BDE.
It seems that to connect to Interbase (at this stage
using the BDE) I must have an Alias set up.
Can someone confirm this for me please (it might
save a lot of time wasting for me trying to do what can't be
done)
TIA
Mark