Board index » delphi » Informix SQL without user name and password

Informix SQL without user name and password

How can I programmatically set the "User name" & "Password" when
connecting to informix through a TQuery?
I don't want the Database login form to show.

 

Re:Informix SQL without user name and password


Quote
nmassaro wrote in message <35083393.6A8B7...@co.jefferson.co.us>...
>How can I programmatically set the "User name" & "Password" when
>connecting to informix through a TQuery?
>I don't want the Database login form to show.

Paste a Database component on you form and give it a name (anything)
in the "DatabaseName" field. Then select the Query component and pull down
the
arrow on its "DatabaseName" field until you see the name you just entered on
the
database component.  You can either use an alias on the database or set the
driver typw to Informix and then set the parameters the same way you woul
for an alias.
You can do this at design time or programmatically.

Set the "LoginPrompt" field on the Database component to FALSE. This
suppresses the
login prompt when you try to connect. Then either in params on the object
inspector or in
your program put whatever Informix wants for username and password. For
Interbase the
default is:

            with My_DB.Params do begin
                Add('USER NAME=SYSDBA');
                Add('PASSWORD=masterkey');
            end; {with}

Other Threads