Solved

Skipping Login when using MSAccess database!

Posted on 1998-10-27
11
169 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

815 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

7 Experts available now in Live!

Get 1:1 Help Now