Updating RecordSet with values of a second RecordSet 
Author Message
 Updating RecordSet with values of a second RecordSet

I am trying to update a recordset by giving the corresponding values from
another open recordset (another connection to a different database on the
same computer,) here is a typical line:

      rsSql.Fields("Title") = rsPdx.Fields("Title").Value

I get the following error (translating from French):

Execution error -2147217887
An OLE-DB operation in several steps has generated errors.

However, the following line works:

      rsSql.Fields("Title")  =  "test"

Could somebody please help me.

Thanks,

Dan Kimhi



Thu, 06 Nov 2003 06:38:56 GMT  
 Updating RecordSet with values of a second RecordSet
1. I would suggest creating a string variable that will store
"rsPdx.Fields("Title").Value"
then set the original 'title" to this string

I  personally normally do not use a ".value" at the end - but that does not
make it incorrect
if your getting errors assigning the rsPdx field to a string then check the
data type of this variable.
you might need to use the str() function to convert this value to a string
ie

Dim strTest as string

strTest = Str(rsPdx.Fields("Title").Value)

bryan

Quote:

> I am trying to update a recordset by giving the corresponding values from
> another open recordset (another connection to a different database on the
> same computer,) here is a typical line:

>       rsSql.Fields("Title") = rsPdx.Fields("Title").Value

> I get the following error (translating from French):

> Execution error -2147217887
> An OLE-DB operation in several steps has generated errors.

> However, the following line works:

>       rsSql.Fields("Title")  =  "test"

> Could somebody please help me.

> Thanks,

> Dan Kimhi



Thu, 06 Nov 2003 10:52:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to set recordset clone to second child level recordset in shape command

2. Update of ado recordset works first time, not second

3. Update recordset from another recordset

4. open recordset, change connection, update recordset?

5. Recordset value changes with .update

6. need help on getting the auto-increment value of a field BEFORE updating recordset

7. Updating Timestamp value in an ADO Recordset

8. ADODB.Recordset.Update does not update?

9. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

10. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

11. Bound controls not updating ADO with adodc.recordset.update command

12. Updating textbox via code not updating recordset

 

 
Powered by phpBB® Forum Software