Solved

Skipping Login when using MSAccess database!

Posted on 1998-10-27
11
170 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

820 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