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
Solved

Access Database connection

Posted on 2001-07-05
11
212 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
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.

 
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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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