Solved

Login to ACCESS-db...

Posted on 2000-03-07
9
187 Views
Last Modified: 2010-05-19
Need some advice on how to avoid the login-prompt when connecting to an access-database. I use Delphi 4 Pro. Using ODBC-alias pointing at the db..

Thanx !
/Erik N
0
Comment
Question by:Erik N
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 2

Expert Comment

by:aubs
ID: 2591634
Hi Erik

If you connect to a database via the TDatabase component, you can set the TDatabase component LoginPrompt property to false.
0
 
LVL 2

Expert Comment

by:aubs
ID: 2591652
Sorry, I should have explained better.

Drop a TDatabase component (from the Data Access tab) on a form and set the alias to the one you are already using.

Set DatabaseName to some arbitrary new alias name, like 'Accesstest'.

Set the loginprompt property to False.

Set the aliases of all other data aware components on the form to this new alias 'AccessTest'.

Regards Aubs
0
 
LVL 17

Expert Comment

by:geobul
ID: 2591772
Hi Erik,

You can write an OnLogin event handler on your TDatabase component as follows:

procedure TForm1.MyDBLogin(Database: TDatabase; LoginParams: TStrings);
begin
  LoginParams.Values['USER NAME'] := 'admin';
  LoginParams.Values['PASSWORD']  := '';
end;

Set TDatabase component properties LoginPrompt to false and KeepConnection to true.

Regards, Geo
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 17

Expert Comment

by:inthe
ID: 2592409
i did this for someone else ,it basically backs up what aubs said:

Odbc:

1:   Open Control Panel, and then select ODBC DataSources (32bit) .
2:   When the Data Source Administrator appears, Click Add.
3:   find the one that says  Microsoft Access Driver (*.mdb)
     click it and click finish.
4:   A dialog will popup called ODBC Microsoft Access Setup
5:   in "data source name" edit box well call it "MyAccess"
6:   description well say is "tesing msaccess connection".
7:   click select and find your .mdb file click ok to select it.
8:   click "advanced" and make sure login name and password are blank.
9:   close advanced.
10:  close microsoft access setup dialog
11:  close the  Data Source Administrator.


delphi:

1:  start or restart delphi if its already running.
2:  start a new project
3:  drop a ttable,tdbgrid,tdatasource,tdatabase on form.

    in object inspector:

4:  datasource1 dataset : table1
5:  dbgrid datasource   : datasource1
6:  database1 aliasname : MyAccess  
7:  database1 databasename : MyAccessDB //tyope some name
8:  database1 loginprompt : false
9:  table1 databasename : MyAccessDB  //is now selectable
10: table1 tablename : select a table
11: database1 connected : true
12: table1 active : true

and viola table should appear with no login prompt
set loginprompt to true and you get the prompt or set to
false and get no prompt.

hope this helps someone somewhere

Regards Barry
0
 

Author Comment

by:Erik N
ID: 2600157
All these worked fine except setting the login params using the ODBC-administrator. My params in the ODBC-administrator is already blanked..

Who want some points ?

/Erik N
0
 
LVL 17

Expert Comment

by:inthe
ID: 2600753
Aubs was first ..
0
 
LVL 2

Expert Comment

by:aubs
ID: 2601030
For a change...
0
 

Author Comment

by:Erik N
ID: 2605144
OK aubs... Propose....
0
 
LVL 2

Accepted Solution

by:
aubs earned 100 total points
ID: 2611686
Thanks!

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 121
Send message from delphi to whatsapp, is it possible? 3 1,458
Delphi XE10 Round Image 2 129
how can i search if string exist in array ? 3 59
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

803 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