I am getting the following error when trying to update an existing Foxpro database using the VFPOLEDB.1 provider and ADO: "Multiple-step operation generated errors. Check each status value."
I have tried about every combination of cursor types and locations but cannot get it to work. Here is my code:
Dim
ADODBConnection As New ADODB.Connection()ADODBConnection.ConnectionString =
"Provider=VFPOLEDB.1;Data Source=F:\xmgmt\data\client.dbc" ADODBConnection.Mode = ADODB.ConnectModeEnum.adModeReadWriteADODBConnection.Open()
Recordset =
New ADODB.Recordset With Recordset.ActiveConnection = ADODBConnection
.CursorType = ADODB.CursorTypeEnum.adOpenDynamic
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.LockType = ADODB.LockTypeEnum.adLockOptimistic
.Open(
"SELECT recordnumber FROM [events] WHERE recno <=0") End With Dim CurrentRecordNumber As Integer = 0 While Not Recordset.EOFCurrentRecordNumber += 1
Recordset.Fields.Item(
"recordnumber").Value = CurrentRecordNumber 'The field 'recordnumber' is of type 'Numeric'Recordset.Update() 'This is where I receive the error
Recordset.MoveNext()
End While
Any help would be greatly appreciated. I have searched all over the web for any answer but have come up with nothing.
Steve