Subject | Changing database path |
---|---|
Author | Jack Cane, PhD |
Post date | 2004-05-02T03:09:29Z |
I am using Firebird hooked to tIboDatabase, compiled with Delphi 6.
Since my new server will have its FireBird connection at a location that is
different from my test environment, my app needs to make a decision at
startup (runtime) as to where to find its database. This is a webhub app and
I set the location with a literal.
In testing, the behavior is as expected when, with the same path, the file
name is changed, but if a new path is given (tracing confirms the new path
is correct), it appears that the app still looks for its data in the
original (design-time) path. I tested with no data at the new location, but
the app made a normal startup, finding its data at the old location.
In addition to the code below, what else do I need to do?
I am assuming that my tIboQuery objects' database name properties will
conform to that of tIboDatabase, and do not have to be separately reassigned
at runtime.
The folllowing code is executed in the FormCreate() method:
with dbOcaf do begin
Connected := false;
DatabaseName := pWebApp.Literal[ 'DatabaseName' ];
try
connected := true;
except on e:exception do begin
(* log the error *)
Application.Terminate;
end; { on e:exception }
end; { try...except }
end; { with dbOcaf }
Tks,
jwc
tks,
jwc
[Non-text portions of this message have been removed]
Since my new server will have its FireBird connection at a location that is
different from my test environment, my app needs to make a decision at
startup (runtime) as to where to find its database. This is a webhub app and
I set the location with a literal.
In testing, the behavior is as expected when, with the same path, the file
name is changed, but if a new path is given (tracing confirms the new path
is correct), it appears that the app still looks for its data in the
original (design-time) path. I tested with no data at the new location, but
the app made a normal startup, finding its data at the old location.
In addition to the code below, what else do I need to do?
I am assuming that my tIboQuery objects' database name properties will
conform to that of tIboDatabase, and do not have to be separately reassigned
at runtime.
The folllowing code is executed in the FormCreate() method:
with dbOcaf do begin
Connected := false;
DatabaseName := pWebApp.Literal[ 'DatabaseName' ];
try
connected := true;
except on e:exception do begin
(* log the error *)
Application.Terminate;
end; { on e:exception }
end; { try...except }
end; { with dbOcaf }
Tks,
jwc
tks,
jwc
[Non-text portions of this message have been removed]