Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Skipping Login when using MSAccess database!

Posted on 1998-10-27
11
Medium Priority
?
174 Views
Last Modified: 2010-04-06
I want to use an MSAccess database as my table source in a D4 program.  However, every time I try to do this, or to look at the database using the Database Desktop or Explorer, I'm asked to Log In.  I can't find where in the "help" it tells how to skip login, so I'm asking y'all...

Is there a way, and if so, what is it!

Thanks in advance,
 Jim 8^)
0
Comment
Question by:Raven1155
  • 5
  • 3
  • 3
11 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 320 total points
ID: 1344663
Ok this is what you need to do.

Use a TDatabase

set LoginPrompt to false

and fill in the following parameters (if needed):

USER NAME
PASSWORD


then attach you tables etc to the tdatabase

regards, Zif.
0
 

Author Comment

by:Raven1155
ID: 1344664
Zif,

Problem!  I tried that, and now I'm getting a "Workgroup file is missing or being used exclusively", and the data file isn't opened (though the DBGrid is)!

I tried running it AFTER closing Delphi, just in case, and that didn't help.

What now?!?!

Yours,
 Jim 8^)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1344665
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1344666
strange I've never received that message, although I work a lot with Acces. Can you past your code?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1344667
For Zif,

here my answer, which references above
it works only in Applications created with Delphi not in the Desktop or Explorer or Designmode, and i think their is no chance to skip this, because its encapsulated in the ODBC driver

Of Course it works in Delphi 3, and i think it works in Delphi 4 also

the Database loginPrompt should be set to true!

------------ The Answer ---------

   use the TDatabase Component,
   give on the Property DataBaseName a name
   give on the Property AliasName the Name of the Alias you want to use

   on the TTable(s) and/or TQuery(s) Components you use the Property DataBaseName should have the
   same entry as TDataBase.DataBaseName.

   Now you can use Following code :

   procedure TForm1.Database1Login(Database: TDatabase;
     LoginParams: TStrings);
   {The Event OnLogin from TDataBase}
   begin
     LoginParams.Values['USER NAME'] := 'YourUserName';
     LoginParams.Values['PASSWORD'] := 'YourPassWord';
   end;

   procedure TForm1.BitBtn1Click(Sender: TObject);
   begin
     {Connect Now}
     database1.connected := true;
     table1.open;
   end;

-------------- End of the Answer -------------

i hope its helpfull

regards   Meikl
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344668
Meikl,

Isn't this the same as I said? Just you do it at runtime, but you can also do it at desingtime.

Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344669
Meikl,

Isn't this the same as I said? Just you do it at runtime, but you can also do it at desingtime.

Zif.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1344670
hi zif,

you have right. Its just the same. I have never tried to use it in DesignMode. Now i have tested it. It works. Thanks for the tip.

meikl
0
 

Author Comment

by:Raven1155
ID: 1344671
Zif,

On the database component, I had the DatabaseName set to a different name than the AliasName.  Oops!  My goof!!

Thanks for your help!

Jim 8^)
0
 

Author Comment

by:Raven1155
ID: 1344672
Zif,

On the database component, I had the DatabaseName set to a different name than the AliasName.  Oops!  My goof!!

Thanks for your help!

Jim 8^)
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344673
No problem. Glad I could help. see ya.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question