Solved

Ms Access

Posted on 1998-05-08
6
173 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
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

15 Experts available now in Live!

Get 1:1 Help Now