This is the problem:
I retrieve one recordset (tmprst) from a db using ADO, then I create another recordset(gridrst) which is a copy of tmprst but with one additinal boolean field. Then I copy the records from tmprst to gridrst. When I come to a numeric field(adnumeric=decimal type on the server) I get the error 'Multiple step operation generated errors. Check each status value'. Fields of all other types, including integer,long integer and double, are copied nicely.
What is going wrong here? I've tried several different approaches but without any luck. (Setting the fieldtype for all fields to advarchar gets the data copied, but I want to keep the field as numeric).
Thanks for any help,
Mats
>>Below is the essential part of the code
'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(0) = True
For i = 0 To tmpRst.Fields.Count - 1
GridRst(i + 1) = tmpRst(i)
Next i
tmpRst.MoveNext
Loop
I retrieve one recordset (tmprst) from a db using ADO, then I create another recordset(gridrst) which is a copy of tmprst but with one additinal boolean field. Then I copy the records from tmprst to gridrst. When I come to a numeric field(adnumeric=decimal type on the server) I get the error 'Multiple step operation generated errors. Check each status value'. Fields of all other types, including integer,long integer and double, are copied nicely.
What is going wrong here? I've tried several different approaches but without any luck. (Setting the fieldtype for all fields to advarchar gets the data copied, but I want to keep the field as numeric).
Thanks for any help,
Mats
>>Below is the essential part of the code
'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(0) = True
For i = 0 To tmpRst.Fields.Count - 1
GridRst(i + 1) = tmpRst(i)
Next i
tmpRst.MoveNext
Loop