G
Guest
I have to following code in ADO (unrelated parts edited out, trouble line has "Trouble Here" directly above it):
Dim cnn as ADODB.Connection
Dim rs as New ADODB.Recordset
Dim strNewTable2 as String
strNewTable2 = "tblTest"
Set cnn = CurrentProject.Connection
rs.Open strNewTable2, cnn, adOpenDynamic, adLockOptimistic
Do Until rs.EOF
If Left(rs.Fields("TestField"), 2) = "zz" Then
'Trouble here
rs.Fields("TestField").Value = Right(rs.Fields("TestField").Value, (Len(rs.Fields("TestField").Value) - 2))
rs.Update
End If
Loop
rs.Close
cnn.Close
Set rs = Nothing
Set cnn = Nothing
Any ideas what I'm doing wrong? The error message is 3251, Object or provider is not capable of performing requested operation. The line worked perfectly in DAO. The value of rs.Fields("TestField") is "zzTest".
Thanks!
Jake
Dim cnn as ADODB.Connection
Dim rs as New ADODB.Recordset
Dim strNewTable2 as String
strNewTable2 = "tblTest"
Set cnn = CurrentProject.Connection
rs.Open strNewTable2, cnn, adOpenDynamic, adLockOptimistic
Do Until rs.EOF
If Left(rs.Fields("TestField"), 2) = "zz" Then
'Trouble here
rs.Fields("TestField").Value = Right(rs.Fields("TestField").Value, (Len(rs.Fields("TestField").Value) - 2))
rs.Update
End If
Loop
rs.Close
cnn.Close
Set rs = Nothing
Set cnn = Nothing
Any ideas what I'm doing wrong? The error message is 3251, Object or provider is not capable of performing requested operation. The line worked perfectly in DAO. The value of rs.Fields("TestField") is "zzTest".
Thanks!
Jake