|The stupid question is the question not asked|
Setting up MS Access as an ODBC Data Sourceby Jazz (Curate)
|on Jan 31, 2002 at 18:52 UTC||Need Help??|
Because MSAccess is an ODBC source, you can work with its files using Win32::ODBC in your program. Win32::ODBC is part of the libwin32 libraries in the Perl standard distribution.
Set up ODBC (if needed), then add the specific database as an the ODBC source.
To do this, go to your control panel and click "ODBC Data Sources". Under the User DSN tab, you should see something like "MS Access 2000 Database" and on the same line, "Microsoft Access Driver". If you do, you're good. If you don't, you'll need to install the additional ODBC drivers from your Win2k cd.
After you've confirmed that that the Access Driver is installed, click "Add" (in the User DSN window), select the Access Driver, then click Finish. Now you're at the setup window. Enter a mnemonic data source name, a short description, then click "Select" and browse to the Access db. If the db is password protected, click "Advanced" and enter the u/p.
At this point the db is registered as an ODBC source.
In your program, use Win32::ODBC and from there, it's straight SQL statements to insert, delete, query, etc.. Docs for Win32::ODBC are here. Here's some sample code:
Win32::ODBC is part of the libwin32 libraries, so if ActivePerl is installed, it ought to be installed correctly already. But you may want to install a more current version if available, which you can do by using the ppm manager (ppm.bat in your perl directory) and typing install libwin32 at the prompt.
Hope this helps,