in reply to DBI Module Question

Hey Guys, Thank you all for taking time to solve my issue. All of you have been really helpful. i tried connecting to the db using a diff driver and got the expected result. even though i am puzzled as to why DBI doesnt work. i am happy that Win32::ODBC works. here is the code.

use Win32::ODBC; $connection = new Win32::ODBC("SQL SERVER") or die "Could not open co +nnection to DSN because of [$!]"; $SQL = "select * from pubs.dbo.authors where au_lname = 'green'"; $connection->Sql($SQL); while($connection->fetchrow()) { @datarow = $connection->Data(); print "@datarow\n"; } $connection->Close();

Replies are listed 'Best First'.
Re^2: DBI Module Question
by runrig (Abbot) on Sep 30, 2009 at 16:10 UTC
    Just keep in mind that Win32::ODBC is less used, so you will be less likely to find help with it (as quickly anyway) if needed. Unless you really need some feature of Win32::ODBC (and that is less likely with the latest versions of DBI and DBD::ODBC), I'd stick with DBI.