Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Error Number 3251 - Insert into Oracle Table

Status
Not open for further replies.

Creepers

Programmer
Nov 11, 2002
116
US
I am getting error number 3251 (Current recordset does not support updating. This maybe a limitation of the provider or the selected locktype.)

I am using Microsoft's OLEDB provider for Oracle. I am running Oracle 9i.

The recordset is opened like this:
lrs.Open "XXROT.ROT_CSI", cnn, adOpenKeyset, adLockPessimistic, -1

The error is at the addnew line:
lrs.AddNew

Any help would be appreciated
 
It is probably a limitation of the provider, since the recordset as defined does support updating. Personally, I prefer not to use Updatable recordsets. I'd rather use command objects and sql insert and update commands.

To do this, just open a client side recordset. Instead of your AddNew, call a proc like this one:
Code:
Private Sub AddARecord(field1 as whatever, field2 as whatever, fieldetc as whatever [...]) as boolean
dim cmd as adodb.command
set cmd = new adodb.command
cmd.activeconnection = myFavoriteConnection
cmd.commandtext = "insert into mytable values('" & field1 & "', " & field2 & ", " [...] "
cmd.execute
addarecord = true
'if an error, set it to false, or get as sophisticated as you want
End Sub
Of course, if you're doing this regularly, it's best to create a stored procedure and run that from a command object.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top