Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi all, This is the error I'm getting, that I can't seem to overcome, nor determine what's causing it.
Sql() ERROR
$SqlStatement: SELECT * FROM Mailing List
$err: 1 1 "-1305"

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.

#!/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();
ppm> query *
Querying target 1 (ActivePerl 5.8.4.810)
1. ActivePerl-DocTools 0.04 Perl extension for Documentation TOC Gene~
2. ActiveState-Relocat~ 0.03 Relocate a Perl installation
3. ActiveState-Rx 0.60 Regular Expression Debugger
4. Archive-Tar 1.07 Manipulates TAR archives
5. Compress-Zlib 1.22 Interface to zlib compression library
6. Data-Dump 1.01 Pretty printing of data structures
7. DB_File 1.809 Perl5 access to Berkeley DB version 1.x
8. DBD-ODBC 1.07 ODBC Driver for DBI
9. DBI 1.43 Database independent interface for Perl
10. Digest-HMAC 1.01 Keyed-Hashing for Message Authentication
11. Digest-MD2 2.03 Perl interface to the MD2 Algorithm
12. Digest-MD4 1.1 Perl interface to the MD4 Algorithm
13. Digest-SHA1 2.06 Perl interface to the SHA-1 Algorithm
14. File-CounterFile 1.01 Persistent counter class
15. Font-AFM 1.18 Interface to Adobe Font Metrics files
16. HTML-Parser 3.34 HTML parser class
17. HTML-Tagset 3.03 Data tables useful in parsing HTML
18. HTML-Tree 3.18 build and scan parse-trees of HTML
19. IO-Zlib 1.01 IO:: style interface to Compress::Zlib
20. libwin32 0.21 A collection of extensions that aims to p~
21. libwww-perl 5.75 Library for WWW access in Perl
22. MD5 2.02 Perl interface to the MD5 Algorithm (obso~
23. PPM3 3.1 Perl Package Manager: locate, install, up~
24. SOAP-Lite 0.55 Library for Simple Object Access Protocol~
25. Tk 800.024 A Graphical User Interface Toolkit
26. URI 1.27 Uniform Resource Identifiers (absolute an~
27. Win32-AuthenticateU~ 0.02 Win32 User authentication for domains
28. XML-Parser 2.34 A Perl module for parsing XML documents
29. XML-Simple 2.09 Easy API to read/write XML (esp config fi~
ppm> q

In reply to SQL err in WIN32 by Robertn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found