http://qs321.pair.com?node_id=378801


in reply to SQL err in WIN32

I think you have everything you need to make the connection. Your syntax looks a little unusual to me, however, and I think the calls to your error routine is what might be giving you a problem. I changed your error statements to something that I'm more familiar with and was able to get past that part of the code. Try something like this for error checking:

my($DSN) = "Lake Alpine"; if (!($db = new Win32::ODBC($DSN))){ die "Error connecting: " . Win32::ODBC::Error() . "\n";

($SqlStatement) = "SELECT * FROM Mailing List"; if ( $db->Sql($SqlStatement)){ { print "error submitting SQL statment " . $db->Error(). "\n"; }

When I run the code with those statements, I get to the next part of the code which executes and it prints out "Read a record" over and over again. If you're going to actually want to read your data, you'll have some work to do on that part of the code. If you find you need help with that part, just come on back and ask more questions.