in reply to Re^2: Accessing Access in Perl
in thread Accessing Access in Perl

I use the following:

$dsn ||= "dbi:ODBC:driver=Microsoft Access Driver (*.mdb);dbq=$dbfile" +;

Note that I have different whitespace. I assume that whitespace is significant.

$dbfile is a filename with backslashes, which should not be significant, but you might want to try both.

Replies are listed 'Best First'.
Re^4: Accessing Access in Perl
by rpike (Scribe) on Sep 23, 2010 at 14:14 UTC
    I must have left something out cause although I thought that is what I had in there it didn't work. I copied your post and it appears to work. Do you have a very simple, generic piece a code that selects everything from the database and prints it to the screen? I'm uncertain of the format and what data is in this database so I need to loop through and print some of the content to screen. One great approach would be to see the structure of the database. I haven't worked on Access/SQL in such a long time so I apologize for some of these noob-like questions. Thanks so much for the help.

      Have you tried opening the file in Access? I find Access a much more convenient application. Alternatively see Querylet.

      Maybe you are looking for a generic SQL statement to list things?

      select * from $tablename

      will give you the contents of a table.