Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Skipping Login when using MSAccess database!

Posted on 1998-10-27
11
Medium Priority
?
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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