views:

502

answers:

4

As part of my university coursework, I was asked to design and create an HCI for a shop. Part of it is to connect Delphi 7 to MS Access and run SQL queries. I have the database connected to Delphi, but when I run the program and enter the query it prompts me to enter a username and password to access the database. Does anyone have any ideas on what's going on? I am stumped for ideas!

Any help is greatly appreciated!

Andy

+11  A: 

Simple solution, the LoginPrompt to FALSE on your TAdoDatabase component. Make sure that your query object then is linked to the database component.

skamradt
Ah, I didn't even see this one! What did you sneak out and answer it?
Jim McKeeth
Part code ninja. :)
skamradt
A: 

hello the value was already set to false that is why i have no clue on what to do! its really weird, any other idea to what it may be? something to do with the data base maybe?

I suggest that you either add this comment to your original question and/or as a comment to skamradt's answer so that the information does not get lost in the shuffle. I almost didn't read this after reading skamradt's answer...
Scott W
A: 

One of the things that puzzles many people is the way Jet user-level security works. When you are running Access, you are logging on whether you know it or not. If you see no username/password prompt when you open an MDB, you are logging on as the ADMIN users with no password.

Thus, to open any Jet MDB, you need to provide a valid username/password pair. If you have not set a password on the admin account, you still need to provide the admin username with no password.

David-W-Fenton
A: 

You need to set the LoginPrompt property to True, but also implement the OnLogin event. In that event, set username (and if available password) of the LoginParams parameter of the event.

NineBerry