Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Need help with DBI problem!!

by mwp (Hermit)
on Apr 16, 2001 at 14:11 UTC ( [id://72796]=note: print w/replies, xml ) Need Help??


in reply to Need help with DBI problem!!

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://72796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-16 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found