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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UpdateBatch Error

Status
Not open for further replies.

Adams

Technical User
Mar 10, 2001
44
0
0
US
Hi, I am using Access 2000. I tried to use "UpdateBatch" method on ADODB recordsets. I set cursor type to adOpenKeyset and LockType to adLockBatchOptimistic. However, the method will only updated one record. If more that one record is entered I receive the following error message with error number "-214467259" and description "Empty row cannot be inserted. Row must have at least one column value set" came up. It is erroring at UpdateBatch. Any suggestions.Many thanks

Call SaveCurrentRecord

'create a new connection instance and open it using the connection string
Set cnCh5 = New ADODB.Connection
cnCh5.Open strConnection

'set the disconnected recordset to the reopened connection
Set rsCustomer.ActiveConnection = cnCh5

'save all changes in the local disconnected recordset back
'to the database

rsCustomer.UpdateBatch

'disconnect the recordset again
Set rsCustomer.ActiveConnection = Nothing

'close the database connection and release it from memory
cnCh5.Close
Set cnCh5 = Nothing

End Sub
 
Check Allow Nulls in your table and make sure that you are updating all fields that needs to be updated.

Herman
Say no to macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top