×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Use Recordset from one connection to Update another

Use Recordset from one connection to Update another

Use Recordset from one connection to Update another

(OP)
Deos anyone know how to use the recordset generated from one adodb connectiion to update the recrodset on a different adodb connection ponting to a differnt database??

RE: Use Recordset from one connection to Update another

what have you tried?

it is possible to get recordsets and close a connection that was used to get the recordset, and keep that recordset in memory.

Get an ADO recordset from a connection, but make sure you use the AdUseClient cursor type, then you can close the connection and loop through it and open another connection and update as you loop through the initial recordset.

see these two:
http://support.microsoft.com/kb/190717/en-us
and
http://support.microsoft.com/kb/184397/en-us

Quote:


Disconnecting a recordset means you can view the recordset's data after severing the connection to the data store that generated the recordset. You can create a disconnected ADO recordset in process with a recordset whose CursorLocation property is adUseClient and whose ActiveConnection property is set to NULL/Nothing. You can then pass this recordset to a remote client using either RDS or DCOM (or both together).

In ADO, you generate the recordset normally, as you would any other recordset, then disconnect it from the connection by setting the Recordset.ActiveConnection property to NULL/Nothing. Then you can close the Connection object.

.....
I'd rather be surfing

RE: Use Recordset from one connection to Update another

(OP)
Yea tried those i can disconnect my recordset and re-connect to a different connection... then loop through the records to add them to my new connection.. but this is really slow as youhave to build up the new record field by field using the syntax like

myrs.addnew
myrs!filedA = mySourceRS!fieldsA
myrs.update

what i really want to be able to do is run an insert or update type SQL statement on the Recordset to bulk update or append a large recrodset..

maybe it cant be done??

RE: Use Recordset from one connection to Update another

The solution depends on the type of ADO connections. For example, is it 2 Access connections, 2 sql server connections, 1 access and 1 sql server connection, or some other connections types. So, what are the 2 connections?  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close