Access Database connection

Posted on 2001-07-05
Medium Priority
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
Question by:ralph78
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

Accepted Solution

karouri earned 200 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)?
LVL 13

Expert Comment

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.
LVL 13

Expert Comment

ID: 6254677
After that you may want to set TADOConnection.LoginPrompt to false.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

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.

Author Comment

ID: 6254738
errr... sorry, but i don't use the ado components (only th bde ones!) with access 97.
LVL 13

Expert Comment

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

Expert Comment

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

LVL 44

Expert Comment

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.

Expert Comment

ID: 6789580

Just a friendly reminder to return to your open questions.

community support moderator

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.
Thank you,

EE Cleanup Volunteer

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

765 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