in reply to Re: Perl OLE32 MSSQL SELECT dateadd function results in “Cursor type changed” error
in thread Perl OLE32 MSSQL SELECT dateadd function results in “Cursor type changed” error

Hi there,

Thank you for taking the time to look into this.

I have been using the WIN32:OLE to run select, update SQL statements against a mssql DB with no issues at all.

Here is a different CPAN where it shows the ADO object under WIN32:OLE is used to execute SQL

http://search.cpan.org/dist/Win32-OLE/lib/Win32/OLE/TPJ.pod

For some reason it is not working for this one statement which is the odd thing.

I will be in the office tmw and will update the code to include the connection string. Thanks,

AJ

  • Comment on Re^2: Perl OLE32 MSSQL SELECT dateadd function results in “Cursor type changed” error

Replies are listed 'Best First'.
Re^3: Perl OLE32 MSSQL SELECT dateadd function results in “Cursor type changed” error
by Anonymous Monk on Dec 09, 2013 at 08:03 UTC
    I recommended you take a look at DBD::ADO, it does all that Win32::OLE ADO stuff for you in familiar DBI style ... so you don't have to suffer the maze of OLE :)
    #!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd pp /; use DBI(); Main( @ARGV ); exit( 0 ); sub Main { my $att = {qw/RaiseError 1/}; my $user = my $pass = undef; my $dbh = DBI->connect("dbi:ADO:$dsn", $usr, $pwd, $att ) ; $dbh->trace(3); my $sth = $dbh->prepare( $mssql_select ); dd( $sth->execute ); dd( $sth->fetchall_arrayref ); }

    See also Tutorials->Database Programming->DBI recipes

      Thanks for the tip, unfortunately I am not able to get DBD installed on this particular environment which is why I am having to use OLE ):