> #!/usr/bin/perl -W
> 
> #=====<< Use the Win32 OLE module >>=====#
> use Win32::OLE;
> 
> #=====<< Open Database & Get Recordset >>=====#
> $conn = Win32::OLE->new("ADODB.Connection");
> $conn->Open("DSN=AscentWeb;UID=ascent;PWD=ascent1");
> $rs = $conn->Execute("select * from ActivityLog;");

I think you have to create the ADODB.Recordset via Win32::OLE, set 
some options and THEN execute the query :


sub SelectForUpdate {
    my $query = shift();

    $query = 'SELECT ' . $query unless $query =~ /^\w*select/i;

    my $conn; $conn = new Win32::OLE "ADODB.Connection"
     or return _error("Can't create ADODB.Connection!");
    $conn->Open($strconnect);
    $conn->State()
     or return _error("Can't open the database!");
    my $rset; $rset = new Win32::OLE "ADODB.Recordset"
     or return _error("Can't create ADODB.Recordset!");
    $rset->{ActiveConnection} = $conn;
    $rset->{CursorType} = adOpenDynamic;
    $rset->{LockType} = adLockOptimistic;
    $rset->Open($query);
    $rset->State()
     or return _error("Failed executing the query");
    return $rset;
}

The default recordset you get from conn->Execute is not updateable I 
think.

Jenda 

== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
: What do people think?
What, do people think?  :-)
             -- Larry Wall in <[EMAIL PROTECTED]>
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to