Hello all,
I would like to update a table with the code below. Do I need to open with different attributes to get it to work?
Please help!!
/P
I would like to update a table with the code below. Do I need to open with different attributes to get it to work?
Please help!!
/P
VBA Code:
Dim RecordSet As ADODB.RecordSet
Set RecordSet = New ADODB.RecordSet
RecordSet.CursorLocation = adUseClient
RecordSet.Open "Select Test1, Test2 from Table WHERE ID = '" & ID & "& "'", Connection, _
adOpenDynamic, adLockBatchOptimistic
RecordSet.MoveFirst
RecordSet.Fields(0).Value = "TEST" <---- Why can I not update like this? Do I need to open with different attributes?
Set RecordSet.ActiveConnection = Connection
RecordSet.UpdateBatch
RecordSet.Close
Set RecordSet.ActiveConnection = Nothing