Subject | Re: [firebird-support] Using a Mapped FB Database for Application |
---|---|
Author | Helen Borrie |
Post date | 2006-05-03T08:11Z |
At 04:42 PM 3/05/2006, you wrote:
aliases.conf to point to the path on the machine that the Firebird
server is running on. Whether you require this to be a specific path
or one decided at the user's discretion is entirely up to you and you
will have to write your installation script accordingly.
Then, in your application, if you are using Fb 1.5, don't use the
hard-wired path at all, use the alias in the application code and in
your ini file; and clean all the cruft out of your database Params
structure before you apply what is read from the ini file.
All this presupposes you are using Firebird 1.5, not Fb 1.0 or
InterBase. So let's be clear about that first. I observe a few
warning signals in your various posts that you might be using an old
version of InterBase and not Firebird at all, e.g. the reference to
QuickReport (which has been gone from Delphi for years) and the fact
that you are possibly using the BDE and driver versions that came
with Delphi 4 or 5, which don't support Firebird 1.5.
If you're stuck about what to do in the Delphi area, there are
examples in the Delphi help. Firebird-support isn't a Delphi forum.
^heLen
> >Well, to keep this on-topic for Firebird, define an alias in
> > *If* there is a Fb or IB server running on the same physical machine
> > as Database Explorer (which is just a client application) AND there
> > is a database file of the given path and name on THAT same machine,
> > then "localhost" will find and connect to THAT database.
> >
> > Note that, by having those parameters in the TDatabase Params
> > property, your application is hard-wired to connect to that
> > testing.gdb database.
> >
>
>During design time, I am able to establish a connection to the
>database using localhost. However, the acutal database that the
>appliation connets to at run-time is determined by the .ini file which
>is read by the application for parameters. Therefore, the 'hard-wired'
>effect only seems to last so long as we are in design time (I believe
>I used it ot validate that things were working)
>
>However, I am concerned that I maybe I should have different detials
>in the TDatabase params field. I have checked the previous code and
>found the TDatabase Param set as follows:
>SERVER NAME=IB_SERVER:/PATH/DATABASE.GDB
>
>This did not seem to work properly during initial development, so I
>changed it to the above (using Localhost:C:\Path\Database.gdb). So, I
>have I missed the subtlety of the programming here by making something
>hard-wired ? I don't quite know how the IB_SERVER:/PATH/DATABASE.GDB
>would work, or where it would retrieve details for the database (which
>I presume it would find and substitute from the .INI file).....so what
>do it do with SERVER NAME now ?
>
>What should TDatabase theoretically point to if I am designing for a
>client who could have a local or remote database ?
aliases.conf to point to the path on the machine that the Firebird
server is running on. Whether you require this to be a specific path
or one decided at the user's discretion is entirely up to you and you
will have to write your installation script accordingly.
Then, in your application, if you are using Fb 1.5, don't use the
hard-wired path at all, use the alias in the application code and in
your ini file; and clean all the cruft out of your database Params
structure before you apply what is read from the ini file.
All this presupposes you are using Firebird 1.5, not Fb 1.0 or
InterBase. So let's be clear about that first. I observe a few
warning signals in your various posts that you might be using an old
version of InterBase and not Firebird at all, e.g. the reference to
QuickReport (which has been gone from Delphi for years) and the fact
that you are possibly using the BDE and driver versions that came
with Delphi 4 or 5, which don't support Firebird 1.5.
If you're stuck about what to do in the Delphi area, there are
examples in the Delphi help. Firebird-support isn't a Delphi forum.
^heLen