?
Solved

Access Database connection

Posted on 2001-07-05
11
Medium Priority
?
221 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
10 Comments
 
LVL 3

Accepted Solution

by:
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)?
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
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.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

840 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