Link to home
Start Free TrialLog in
Avatar of MartinC
MartinC

asked on

How do I make Login Prompt go away?

I am using a Microsoft Access database on a Delphi app.  I am using just a TDatabase, and a TQuery. I have the TDatabase component's LoginPrompt property set to False, yet it constantly brings up a login prompt when i run the app in Delphi, or by doubleclicking the exe.

Is there something I am missing, to make the damn thing just RUN without having to login?

MartinC
Avatar of geobul
geobul

Hi,

You have to suply username and password using TDatabase.OnLogin event this way:

procedure TForm1.Database1Login(Database: TDatabase; LoginParams: TStrings);
begin
  LoginParams.Values['USER NAME'] := 'admin';
  LoginParams.Values['PASSWORD']  := '';
end;

Regards, Geo
Avatar of MartinC

ASKER

Nope, that doesn't work. I can't get the Database to execute the code in the OnLogin event. The prompt come up immediately on opening the application. I am not using any command like "Database1.Open" or anything similar. when I DO that, I get "DatabaseName missing" as an error - and it still does not run the OnLogin code.

I have the database properties set as follows:

AliasName: ECLDB
Connected: False
DatabaseName:
DriverName:
Exclusive: False
HandleShared: False
Keep Connection: True
LoginPrompt: False
Name: Database1
Params:
ReadOnly: false
SessionName: Default
Tag: 0
TransIsolation: tiReadCommitted

I am just trying to use it as a basic database. it accesses all the data fine through a query attached to it.
Avatar of Pierre Cornelius
Set the LoginPrompt property of the TDatabase component to false...

Regards
Pierre
ASKER CERTIFIED SOLUTION
Avatar of geobul
geobul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MartinC

ASKER

geobul:

Thanks, that was it; I didn't have it set up properly in the first place. I'm surprised it worked at all. Points!
Pleasure was mine :-)