Board index » delphi » Retrieve username and password from TDatabase component

Retrieve username and password from TDatabase component

My program has a TDatabase component which is responsible for Transaction handling.
When I run program, a login prompt is automatically popup for username and password
because the active property of this TDatabase component is set to True. Can any one
tell me how can I retrieve the username and password from the TDatabase component ?
It is because I need the username and password to load a ReportSmith report without
the user to login the database again.

Thank you very much.

O.K.Man

 

Re:Retrieve username and password from TDatabase component


Quote
okman wrote:

> My program has a TDatabase component which is responsible for Transaction handling.
> When I run program, a login prompt is automatically popup for username and password
> because the active property of this TDatabase component is set to True. Can any one
> tell me how can I retrieve the username and password from the TDatabase component ?
> It is because I need the username and password to load a ReportSmith report without
> the user to login the database again.

> Thank you very much.

> O.K.Man

TDatabase.Params.Values['USER NAME']
TDatabase.Params.Values['PASSWORD']

-Bryan

Re:Retrieve username and password from TDatabase component


Quote
okman wrote:

> My program has a TDatabase component which is responsible for Transaction handling.
> When I run program, a login prompt is automatically popup for username and password
> because the active property of this TDatabase component is set to True. Can any one
> tell me how can I retrieve the username and password from the TDatabase component ?
> It is because I need the username and password to load a ReportSmith report without
> the user to login the database again.

> Thank you very much.

> O.K.Man

Ignore my first post. That won't work if you use the automatic login prompt. (I
just tried it). What I do is get the user name and password on my own, set the
TDatabase.Params and then set Connected to true without the login prompt. That
way you get the user name and password yourself, and can use it elsewhere. You
can also make a nicer, custom login screen that way.

Sorry about my mistake!

-Bryan

Other Threads