hi all, haven't worked with this for a while - still, don't remember getting this error message ever ... The code I'm running is below:
use Win32::OLE; use Win32::OLE::Const; $db = "db1"; $srv = "mySrv"; $uid = "usr1"; $pwd = "usr1pwd"; #this is an OLEDB connection to a MS-SQL Database $connStr = "PROVIDER=SQLOLEDB;SERVER=$srv;DATABASE=$db;UID=$uid;PWD=$pwd"; $conn = Win32::OLE-> new("ADODB.Connection") or die "Error creating Connection Object\n"; $rs = Win32::OLE->new('ADODB.Recordset') or die "Error creating Record Set Object\n";; $conn-> Open($connStr); $rs->Open('Balance', $connStr, $ado_consts->{adLockOptimistic}); my $Fields = ['ItemId', 'ItemDate', 'ItemAmount', 'ItemComments']; my $Values = [1, '2006-11-29 2:50:01', '12.34', 'insert try 1']; $rs->AddNew($Fields, $Values); # adds a record print "\nThis didn't go thru: ", Win32::OLE->LastError(), "\n" if (Win32::OLE->LastError()); $rs->Close(); $conn-> Close(); When executing the above I get: This didn't go thru: OLE Exception from "ADODB.Recordset": Current Recordset does not support updating. This is a limitation of the provider, or of the selected locktype. When using the code without the $rs->Open( ... line it will complain about executing the AddNew method on a closed object; when adding $rs->Open() with the params above it will issue the error. Any ideas? Thanks, Dan ____________________________________________________________________________________ Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs