Solved

Ms Access

Posted on 1998-05-08
6
176 Views
Last Modified: 2010-04-06
Could some one give an example App on how to connect to an Access database using DAO or OBDC?  I do not want to use the BDE.
0
Comment
Question by:caoidx1
[X]
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
6 Comments
 

Expert Comment

by:chrb
ID: 1343748
Have you checked DSP or Torry's Delphi page? I have found some examples there. If you want I can find them for you.

Chr
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1343749
I used this once can't remember were I got it though

to create a link to the ODBC driver

1. First start the BDE Administrator from the Windows Start Menu
(it will be in the Delphi 3.0 folder.)

2. Now select Object|ODBC administrator from the main menu.
(this will bring up a list of currently installed drivers.)

3. Choose Add and then select the ODBC driver you would like to create
a data source for, then click on OK.

4. Next fill in the appropriate information for your driver.
(A minimal configuration will require the  Data Source Name field.
You will also need to fill in at least one other field that is a
location specifier for the data. This could be a path in the case of
Paradox or dBase tables or the Server field in the case of configuring
an Interbase ODBC driver.  Some non-exhaustive examples include; if

you are using Interbase you would select a path to a .GDB file, if
using Paradox or dBASE files you would specify the data directory
containing your tables or if you were using Oracle you would specify
the entry as it appears in your TNSNAMES.ORA file.  Once this is done
you have created a virtual driver and will be able to access your
database files through the datasource your created.)

Hope this helps if not just reject it

Later
BoRiS
0
 

Author Comment

by:caoidx1
ID: 1343750
What is the proposed answer?
0
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!

 
LVL 1

Expert Comment

by:ssite
ID: 1343751
I have a real answer for you. reject the current one.
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1343752
Do you still want to know how to do this...I'll put up how to do it with native drivers now if you want to know how to use ODBC I'll answer that later

1) open a new application...File | New Application
2) click on the Data Access Tab in your component pallet
3) select the Database component and drop it on your form
4) double click the Database component to reveal a dialog box
5) under Name put MyTestDB
6) under Alias name leave it blank
7) under Driver name put MSACCESS
8) click on the button Defaults
you will see

DATABASE NAME=DRIVE:/PATH/DATABASE.MDB
USER NAME=
OPEN MODE=READ/WRITE
LANGDRIVER=
SYSTEM DATABASE=
PASSWORD=

in the box to the left

after DATABASE NAME= put in the drive and path and name of your Access database

9) click OK
10) in the object inspector (that thing that has the properties and events tabs) go to the Connected property and set it to true.  This should pop up a login box, leave the fields blank and hit OK.  If you don't get an error you did it right.
There are a couple reason that you have failed.  If you get an error like MSACCESS -102764 error Please look at this web page

http://support.microsoft.com/support/kb/articles/Q141/2/94.asp

it will tell you how to reregister the dll...this happens after installing 97 on a system that had 95 on it before.  Hop this helps ODBC it about the same in dificulty but you don't have as many "wacko" thinks that can happen...NOTE:these "things" only pertain to the initial set up Native drivers are about 20 times better than the ODBC. (this is my opinion...I only use Access for design and depoly using MSSQL)


0
 
LVL 1

Accepted Solution

by:
ssite earned 50 total points
ID: 1343753
Hey guys, the man said he does not want to use the BDE.

caoidx1 :

You have two possibilities :
Use the access objects via ole (using the api createobject function). This is not recommended if you plan to write a real access app, because it will make your life very difficult as opposed to VB for example.

The real solution will cost you about 300 $. There's a swiss company called Opus, they wrote a DAO wrapper for delphi. It's excellent. No problems and I'm even using their first version.

goto www.opus.ch   

have fun.

P.S, not that it matters too much, but I would expect a little more than 50. :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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