2

I ultimately want to query an existing MS-Access database (say, contacts.mdb) from a Lazarus program I will write.

It appears that configuring a User DSN is the first step.

In the ODBC DSA, I am stuck at Adding a driver for MS-Access databases. What do I need to download for this?

OK, I'm starting over from scratch. Please bear with me.

I'm now trying to use the Lazarus example given at wiki.lazarus.freepascal.org/MS_Access.

Following the Instruction given as "Goto your [Data sources (ODBC)] at the control panel administrative tools..." I run /usr/bin/ODBCConfig and get an error which says "Invalid window handle." Clicking OK closes without anything.

Does this mean I've gotten everything so FUBAR that's it's hopeless?

Fionnuala
  • 90,370
  • 7
  • 114
  • 152

3 Answers3

2

If your program is written in PHP you can use php5-odbc for access any odbc source, like mssql server or access databases.

This post http://phplens.com/phpeverywhere/node/view/9 illustrate you all the necessary step.

  • Useful info for PHP people, but OP has already stated he'll be using Lazarus (http://www.lazarus.freepascal.org) – Rob Cowell Nov 10 '10 at 13:38
1

Thsi might be the thing you need

http://www.easysoft.com/products/data_access/odbc-access-driver/

Rob Cowell
  • 1,610
  • 3
  • 18
  • 34
  • Thanks for the reply. I tried this without success. Also, I can't afford the license. –  Nov 14 '10 at 19:14
0

I think it should be enough to put something like the following in ~/.odbc.ini:

[Contacts]
Description = The Contacts Database
Driver = /usr/lib/libmdbodbc.so
Database = /home/dkjmusic/data/contacts.mdb

Of course you need an MDB ODBC driver (e.g. libmdbodbc Install libmdbodbc http://bit.ly/software-small) to be installed

JanC
  • 1,264
  • 9
  • 6
  • OK. I did this. So, now I'm trying to use the Lazarus example given at http://wiki.lazarus.freepascal.org/MS_Access. So my ~/.odbc.ini looks like: [Database1]Description = The Lazarus example database Driver = /usr/lib/libmdbodbc.so Database = /home/dennis/Documents/Lazarus Projects/msaccesstest2/Database1.mdb\ –  Nov 14 '10 at 19:02
  • ...but no connection is possible. –  Nov 14 '10 at 19:29
  • It seems like that example uses a "File DSN", and not a "User DSN"? I think a "file DSN" would contain the same, but would be stored in a *.dsn file somewhere in you project's folder? – JanC Nov 15 '10 at 13:48