Robertn has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to pull data out of an MS Access database. There was no PERL on the machine until the other day so everything is current, as of Tuesday, and the PC is running W2K. Figured out the ODBC manager so I'm able to connect to the database (I think), but err when I do the first SELECT. And I've quintiple checked, Mailing List is the table in the Lake Alpine mdb. In trying to track down an answer, examples I've seen on the net, show a real error message rather than the -1305, So I'm wondering if I've really got everything I need installed. Aside from the win32::odbc package, I can't find an authoritative list of packages that should be installed, if you want to access, Access. I'm a victim of not knowing what I don't know as Windows is not my native environment. Any clues or hint's would be greatly appreciated, especially if you can tell me how to make the error messages appear. My humble thanks in advance.
ppm> query *#!/usr/bin/perl -w use strict; use lib("."); use DBI; use DB_File; use Win32::ODBC; my ($db,%Data,$SqlStatement,$err ); my($DSN) = "Lake Alpine"; if (!($db = new Win32::ODBC($DSN))){ print "Error connecting to $DSN\n"; print "Error: " . Win32::ODBC::Error() . "\n"; exit; } ($SqlStatement) = "SELECT * FROM Mailing List"; if ( $db->Sql($SqlStatement)){ $err = $db->Error; warn "Sql() ERROR\n"; warn "\t\$SqlStatement: $SqlStatement\n"; warn "\t\$err: $err\n"; $db->Close(); exit; } while( $db->FetchRow() ) { undef %Data; %Data = $db->DataHash(); print "Read a record.\n"; } $db->Close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SQL err in WIN32
by EdwardG (Vicar) on Jul 30, 2004 at 08:57 UTC | |
by Robertn (Hermit) on Jul 31, 2004 at 02:18 UTC | |
|
Re: SQL err in WIN32
by WhiteBird (Hermit) on Jul 30, 2004 at 20:27 UTC | |
by Robertn (Hermit) on Jul 31, 2004 at 02:30 UTC | |
by WhiteBird (Hermit) on Jul 31, 2004 at 15:27 UTC | |
by Robertn (Hermit) on Aug 01, 2004 at 20:45 UTC | |
by WhiteBird (Hermit) on Aug 02, 2004 at 13:31 UTC | |
|
Re: SQL err in WIN32
by EdwardG (Vicar) on Jul 31, 2004 at 11:47 UTC | |
|
Re: SQL err in WIN32
by runrig (Abbot) on Aug 01, 2004 at 21:11 UTC |