Win has asked for the wisdom of the Perl Monks concerning the following question:
The important bits of Perl code for this are:U:\2004_2005\Development\Perl_development\20_October_2004>perl 20_Octo +ber_2004_E.pl DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Inval +id cursor state (SQL-24000)(DBD: dbd_describe/SQLNumResultCols err=-1) at 20_Oct +ober_2004_E.pl line 290. Couldn't execute query: [Microsoft][ODBC SQL Server Driver]Invalid cur +sor state (SQL-24000)(DBD: dbd_describe/SQLNumResultCols err=-1) at 20_October_2 +004_E.pl line 290.
Then, after the query is defined.#! perl -w scipt use strict; use warnings; use DBI; use DBD::ODBC; my ($data_source, $database, $user_id, $password) = qw( <ip address> S +eries_requests ********* ********* ); my $conn_string = "driver={SQL Server}; Server=$data_source; Database= +$database; Trusted_Connection=yes"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::errstr;
my $sthB_A = $dbh->prepare("$Query_A") or die "Couldn't prepare que +ry: ".$dbh->errstr; $sthB_A->execute() or die "Couldn't execute query: ".$sthB_A->errstr +;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ODBC problem
by mpeppler (Vicar) on Nov 12, 2004 at 10:19 UTC | |
by Win (Novice) on Nov 12, 2004 at 11:59 UTC | |
by ikegami (Patriarch) on Nov 12, 2004 at 14:50 UTC |