Board index » delphi » Setting username & password for TDataBase during runtim

Setting username & password for TDataBase during runtim

Hello, I have an application that requires accessing data from three different AS400 systems.  Is there a way to progamatically set the username and password for each database object?  I have a username and a pasword text box so I would like to pass those fields into the username and password param fields for the TDatabase component.

Any help would be greatly appreciated.

 

Re:Setting username & password for TDataBase during runtim


Database1.Params.Add('UserName=TheName');
Database1.Params.Add('Password=ThePassword');

On 20 Jan 2003 13:51:24 -0800, "Dwaine Horton"

Quote
<dwaine.hor...@york.com> wrote:

>Hello, I have an application that requires accessing data from three different AS400 systems.  Is there a way to progamatically set the username and password for each database object?  I have a username and a pasword text box so I would like to pass those fields into the username and password param fields for the TDatabase component.

>Any help would be greatly appreciated.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Re:Setting username & password for TDataBase during runtim


Ok, I placed this in the onlogin procedure for each of my database objects and it still keeps asking me to login.  Should I set these before I open or execute my queries?

Quote
Bill Todd <b...@notthis.dbginc.com> wrote:
>Database1.Params.Add('UserName=TheName');
>Database1.Params.Add('Password=ThePassword');

>Bill (TeamB)
>(TeamB cannot respond to questions received via email)

Re:Setting username & password for TDataBase during runtim


Quote
"Dwaine Horton" <dwaine.hor...@york.com> wrote in message

news:3e2cbc97$1@newsgroups.borland.com...
Quote

> Ok, I placed this in the onlogin procedure for each of my database objects

and it still keeps asking me to login.

Set the TDatabase's LoginPrompt to False.

--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
"Democracy, without that guarantee of liberty, is merely a method of
selecting tyrants." - Alan Nitikman

Re:Setting username & password for TDataBase during runtim


You must also set the LoginPrompt property to false.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads