Solved

Skipping Login when using MSAccess database!

Posted on 1998-10-27
11
167 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 80 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now