You'd do well to follow ColtsFoot's advice. If you haven't set up a datasource, putting the database file (.mdb) in the same directory as the script isn't enough. ("database" NE "datasource") You have to go to "Control Panel > ODBC Data Sources" and configure a driver. If you have no idea what I'm talking about, you should probably read the documentation for DBI::ODBC.
Also remember to use double quotes when you want to interpolate a variable in a string:
1 'DBI:ODBC:$DSN' == DBI:ODBC:$DSN 2 "DBI:ODBC:$DSN" == DBI:ODBC:my_database.mdb
In your example, you're sending #1 to the database driver, which it isn't going to like, because it has no idea what $DSN means. You want to use double quotes, and send it the name of the datasource, not the name of the variable. Follow?
In reply to Re: Need help with DBI problem!!
by mwp
in thread Need help with DBI problem!!
by grax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |