Solved

Access Database connection

Posted on 2001-07-05
11
209 Views
Last Modified: 2010-04-06
i want to connect an access database from my application, without using any aliases. could anyone help me?

regard, raph
0
Comment
Question by:ralph78
11 Comments
 
LVL 3

Accepted Solution

by:
karouri earned 50 total points
ID: 6254666
first thing i can think of is, if you are using Delphi 5+ then use the ADO components, then you can write the ConnectionString at run time. If you want to use the BDE (in any delphi), then you can use a TDAtabase at run time too. Beware of using the BDE driver for Access 95 to open an Access 97 database.
So, what Delphi are you using, what Access version, and do you want to use the BDE (I hope not)?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6254669
If you have the ADO components, drop a TADOConection on your form and double-click on it. Then click 'Build'. Select 'Microsoft Jet 4.0 OLE DB Provider', 'Next' and type/browser the .mdb file (path can be relative or absolute). Now 'Test Connection' to see if it works.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6254677
After that you may want to set TADOConnection.LoginPrompt to false.
0
 
LVL 3

Expert Comment

by:alzv
ID: 6254688
Well... Use ADOExpress components (ADO tab).

1. Place ADOConnection component onto your form
2. Doubleclick on it to open ConnectionString editor
3. Press Build button
4. Choose Microsoft Jet OLE DB Provider and press Next
5. Select Access database file
6. Specify Password if needed
7. Press Test Connection button and if connection succeed press OK
8. Place ADOTable component and set its Connection property to previously placed ADOConnection component
9. Specify TableName property
10. Place DataSource component from Data Access tab and set it DataSet property to previously added ADOTable component
11. Place DBGrid component and specify its DataSource property
12. Set Active property of ADOTable component to True.

Best regards,
Alexey Zverev.
0
 

Author Comment

by:ralph78
ID: 6254738
errr... sorry, but i don't use the ado components (only th bde ones!) with access 97.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 13

Expert Comment

by:Epsylon
ID: 6254785
Then I don't know a solution...
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6254791
...unless creating an alias at runtime is an option:

http://www.bhnet.com.br/~simonet/tipstricks/alias.htm
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6255717
Yep as Epsylon has said if you don't use ADO then you will need to use alias's in one form or another.
0
 

Expert Comment

by:amp072397
ID: 6789580
ralph78:

Just a friendly reminder to return to your open questions.

thanks!
amp
community support moderator

2/7
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8702025
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept karouri's comment as answer (TDatabase at runtime)

From Delphi Help:
-----------------
AliasName and DriverName are mutually exclusive BDE-specific properties. AliasName specifies the name of an existing BDE alias to use for the database component. The alias appears in subsequent drop-down lists for dataset components so that you can link them to a particular database component. If you specify AliasName for a database component, any value already assigned to DriverName is cleared because a driver name is always part of a BDE alias.

Note: An application can specify the DatabaseName, DriverName, and Params properties rather than setting AliasName if the desired BDE alias configuration does not already exist. An application can also provide an application-specific “alias” name by setting DatabaseName when AliasName is already set.
-----------------

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

14 Experts available now in Live!

Get 1:1 Help Now