Database connection

I have successfully connected to Access database via ODBC. Now I would like to get rid of database login prompt (I dont need it - very annoying). Is there a way to do this?
MalensekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
hi,
if you have a TDatabase on the form you can set loginprompt to false; (in object inspector).
0
JaccoCommented:
apart from setting LoginPrompt to false you will also have to specify the username and password in the TDataBase.Parameters: something like:

USER=SYSDBA
PASSWORD=masterkey

Regards Jacco
0
MalensekAuthor Commented:
I have tried to use TDatabase component to login to database, but login prompt still exist.
0
muldeyurCommented:
Hi You can also try this :

Constructor TDb.Create;
begin
  DB := TdataBase.Create(nil);
  DB.OnLogin := DBLogin;
end;


procedure tDBMod.DBLogin(Database: TDatabase; LoginParams: TStrings);
// Set Password & UserName
begin
  LoginParams.Values['USER NAME'] := UserName;
  LoginParams.Values['PASSWORD'] := Password;
end;

When you do it like this it won't sho you the login prompt!!

regards,

Yuri
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wimmeyvaertCommented:
Hello Malensek,

Like INTHE said, have you set the LoginPrompt-property of your DataBase-component to False ?

I think Inthe has the best solution if the user don't have to login to the database.

Best regards,
The Mayor
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.