Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql error when accessing acces file from delphi 5 >>

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi there.. I have windows xp installed with delphi 5 and access 2000. Now when i'm trying to access a *.mdb file from delphi, I get een sql error -2147221164.
Does anyone know's the answer to my problem ???
Many thnx in advance..
 
hi,

You cann't use an *.mdb file in your queries. The just way to approach this to make an obdc connection to the *.mdb file and make a query which selects data from a table which resides in the *.mdb

Steph [bigglasses]
 
I see.. but with access 97 it was working ok.. strange.
But can you tell me how to make that odbc connection ??
(i'm very new with databases) :)
 
You can also use the Borland Database Engine.

1) Start up the BDE Administrator and create a new object (we call it alias).

2) Select the MSACCESS driver

In Database name select your Database with full path

In Delphi set the Database Property of the table or query to the alias you just created.

With this approach you are using the native Access driver shipped with Delphi.

To make an odbc connection use the ODBC datasources in the control panel instead of step 1 and 2.

The odbc connection will appear as an alias in the BDE administrator.

My experience with ODBC is that long as it installed automatically or before you install Delphi it works fine. If you do it yourself you can run into trouble because @#% Microsoft has a patch or update every week, which brings version conflicts.


S. van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top