I have tried to solve this problem for quite a while without any success, I just can't figure out what's going wrong.
The code opens one recordset which is retrieved from a db, then a second recordset is generated that is a copy of the first but with one boolean field added. Everything goes well until the procedure starts copying records from the first recordset to the second. All string fields are copied nicely, but numeric fields generate an error.No errorcode, just 'Multiple step procedure created error' (or something like that). At my development computer I use an Access db for testing, and everything works fine, but in production I'm accessing a MS SQL 6.5 database, and the error appears.
Can anyone figure out what's going wrong?
Thanks,
Mats
>> Below the essential part of the code
tmpRst.CursorLocation = adUseClient
tmpRst.Open SqlStr, FilterDb, adOpenStatic, adLockReadOnly
GridRst.CursorLocation = adUseClient
GridRst.CursorType = adOpenDynamic
GridRst.LockType = adLockOptimistic
'Create fields in GridRst
GridRst.Fields.Append "X", adBoolean
For i = 0 To tmpRst.Fields.Count - 1
GridRst.Fields.Append tmpRst(i).name, tmpRst(i).Type, tmpRst(i).DefinedSize, tmpRst(i).Attributes
Next i
GridRst.Open
'Copy records from tmpRst to GridRst
Do Until tmpRst.EOF
GridRst.AddNew
GridRst("X"
= True
For i = 0 To tmpRst.Fields.Count - 1
GridRst.Fields(i + 1) = tmpRst.Fields(i)
Next i
GridRst.Update
tmpRst.MoveNext
Loop
The code opens one recordset which is retrieved from a db, then a second recordset is generated that is a copy of the first but with one boolean field added. Everything goes well until the procedure starts copying records from the first recordset to the second. All string fields are copied nicely, but numeric fields generate an error.No errorcode, just 'Multiple step procedure created error' (or something like that). At my development computer I use an Access db for testing, and everything works fine, but in production I'm accessing a MS SQL 6.5 database, and the error appears.
Can anyone figure out what's going wrong?
Thanks,
Mats
>> Below the essential part of the code
tmpRst.CursorLocation = adUseClient
tmpRst.Open SqlStr, FilterDb, adOpenStatic, adLockReadOnly
GridRst.CursorLocation = adUseClient
GridRst.CursorType = adOpenDynamic
GridRst.LockType = adLockOptimistic
'Create fields in GridRst
GridRst.Fields.Append "X", adBoolean
For i = 0 To tmpRst.Fields.Count - 1
GridRst.Fields.Append tmpRst(i).name, tmpRst(i).Type, tmpRst(i).DefinedSize, tmpRst(i).Attributes
Next i
GridRst.Open
'Copy records from tmpRst to GridRst
Do Until tmpRst.EOF
GridRst.AddNew
GridRst("X"

For i = 0 To tmpRst.Fields.Count - 1
GridRst.Fields(i + 1) = tmpRst.Fields(i)
Next i
GridRst.Update
tmpRst.MoveNext
Loop