Board index » delphi » using TSession without LoginPrompt

using TSession without LoginPrompt

I'm using INTERBASE with DELPHI 5 and execute SQL-Statements via
TQuery and TDatabase.
When setting TDatabase.LoginPrompt = False and TDatabase.Params  to correct
USER NAME and PASSWORD, I don't need to login manually when starting the
application.
Now I added a TSession (because I have more than one thread)  and created
the TDatabase with this TSession as owner. This works fine with several
threads.
But when I now execute the TQuery.Prepare (or any other action on database)
for the first time, I get a LoginPrompt. What can I do to get rid of it ???

Thank You

 

Re:using TSession without LoginPrompt


Quote
> You need to do the same thing with the TDatabase you are creating withing
> your thread as you did with the one you dropped on your form or data
module.
> You must set LoginPrompt to False and add the username and password

params.

Thank you for response.
Your way did't work, but meanwhile I found the answer myself.
I have to set TQuery.SessionName := TDatabase.SessionName.
Otherwise TQuery uses the default Session, which wasn't logged in to that
time.

Other Threads