Subject Re: [IBO] [newbie] Connection?
Author joaquimmacedo <joaquimmacedo@yahoo.com>
Thanks Daniel, for your reply.

What I mean is if I can use the same program on my laptop - to
connect to a local database - and also use the same program to
connect to a database that is on server - for example, on a client of
mine.
How can I tell my program to connect to a local database on my
computer and on a network to connect to a database on a server?


On BDE I have a BDE alias. When I´m working on my computer, I change
the path to a local path. When I´m working on my client, I change the
path to a path on the server. So, the same program runs on my
computer and on a network.


Best regards,
Joaquim.


--- In IBObjects@yahoogroups.com, Daniel Rail <daniel@a...> wrote:
> Hi,
>
> > Hi all.
>
> > At this point I'm studying "Tutorial1", on the folder:
> > "......\IBO\Tutorials\BasicTutorials".
>
> > As I see, the database path, server name, username and password
are
> > on the program itself.
>
> > Is there any way that I manage this dynamically?
> > On my computer, I want to use a local database. On a client, I
would
> > use a network database. If I get more clients, then the path and
> > server name could be different.
>
> Those properties can be set in run-time before you connect to the
> database. I do it all the time.
>
> Here's a quick example:
>
> IB_Connection1.Path := 'c:\MyPath';
> IB_Connection1.Server := 'My Server';
> IB_Connection1.Protocol := cpTCP_IP;
> IB_Connection1.Username := 'SYSDBA';
> IB_Connection1.Password := 'masterkey';
> IB_Connection1.Connect;
>
>
> Daniel Rail
> Senior System Engineer
> ACCRA Group Inc. (www.accra.ca)
> ACCRA Med Software Inc. (www.accramed.ca)