tarval0n has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, Is there a way to return the number of rows in an update query using adodb.connection? I am using win32::ole to access the object. What I would like to do is to execute and update statement, determine whether there are any rows affected, and perform an insert if no records are affected. I have tried searching various knowledge bases but my efforts have been in vain so afr. Any help would be greatly appreciated. Thanks!

Replies are listed 'Best First'.
Re: ADODB.Connection Return number of rows
by xorl (Deacon) on Mar 02, 2006 at 13:26 UTC

    The VB code you need to execute is:

    set RS = CreateObject("ADODB.Recordset") set NUM = RS.RecordCount
    I don't use win32::ole so I'm not sure exactly how you'd do it. My guess would be something like:
    $records = $Object->{RS} = ("adodb.Recordset"); $count = $Object->LetProperty("RecordCount", $records);