Subject Re: [IBO] IBO and lookup fields
Author Jason Wharton
Hmmm.... I can't quite make sense out of this code. May I suggest that you
tap into the already existing code to store the last connection path and
username in the registry?

Put the string:

%DEFAULT%

in the LoginRegKey property of the connection and it will maintain all this
for you.

If you want the user to be able to change where the database is then set the
LoginDBReadOnly accordingly. If true then they cannot change it in the
dialog. I'm debating on making an alias system where they will have a list
of choices since it won't be long and aliases will be built into the
server...

FWIW,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Dorin Pacurar" <ged@...>
To: <IBObjects@egroups.com>
Sent: Thursday, November 30, 2000 6:53 PM
Subject: Re: [IBO] IBO and lookup fields


>
> function Tdm.Conectare: Boolean;
> Var S: String;
> begin
> with cn do begin
> Connected := False;
> // Here is setting the RegKey to S -> for the Path
> if not CitesteCheia(RegCheie,'IBPath',S) then begin
> Path:=IBO_PATH; // Set the Path to my predefined Path
> LoginPrompt:=True;
> end else begin
> LoginPrompt:=False;
> // Here is setting the RegKey to S -> for the Server
> if not CitesteCheia(RegCheie,'IBServer',S) then begin
> Server:='';
> Protocol:=cpLocal;
> end else begin
> Server:=S;
> end;
> end;
> if UpperCase(Server) = aStation then Protocol:=cpLocal else
> Protocol:=cpTCP_IP;
> // aStation is the name of the local host
> with Params do begin
> Values['USER NAME'] := IBO_USER; file://'SYSDBA'
> Values['PASSWORD'] := IBO_PSW; file://'masterkey'
> end;
> try
> cn.Open;
> except
> LoginPrompt:=True;
> cn.Open;
> end;
> end;
> Result:=cn.Connected;
> end;
>
> ----- Original Message -----
> From: "Jason Wharton" <jwharton@...>
> To: <IBObjects@egroups.com>
> Sent: 01 decembrie 2000 03:25
> Subject: Re: [IBO] IBO and lookup fields
>
>
> > Show us your code.
> >
> > Jason Wharton
> > CPS - Mesa AZ
> > http://www.ibobjects.com
> >
> >
> > ----- Original Message -----
> > From: "Dorin Pacurar" <ged@...>
> > To: <IBObjects@egroups.com>
> > Sent: Thursday, November 30, 2000 5:44 PM
> > Subject: Re: [IBO] IBO and lookup fields
> >
> >
> > > That's it ! Back to the light.
> > > Thanks !
> > > Now something else:
> > >
> > > I try do do the following:
> > > If my app run's for the first time I set up the connection (with
> > Connection
> > > dialog from IBO_Login) and write a registry key with the full path of
> the
> > > Database and the server name).
> > > Next time, I read the Path and Server from the Registry, but the
server
> > > name appeares in front of Path (ex: 'linux:linux:/tmp/mydb.gdb'
instead
> > > of'linux:/tmp/mydb.gdb').
> > > I need also to change the Database from my app.(Connect to another
> > > Database).
> > > The problem is that Server, Path and Protocol properties are not
> updated
> > > after the connection is made.
> > > Am I missing something ?
> > >
> >
> >
> >
> >
> >
>
>
>
>
>