473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

copy contents of recordset to a table

Hi,

I get data from sybase server using ADO Connection and disconnected recordset in my access Database.

Now I have a disconnected recordset. I want to insert the contents of this recordset into a Access table. I can loop through the recordset and insert record by record. But I want to do a bulk insert/Update assuming the columns are the same in the recordset and the table.

How can I copy a recordset data to a table in one shot?

The recordset is a disconnected recordset which was queried from another database.

Thanks
mustang123
Sep 20 '07 #1
2 9240
NeoPa
32,556 Expert Mod 16PB
What do you mean by a disconnected recordset?
I know of tables and queries as objects and (ADODB & DAO) recordsets in code.
My answer (if I were sure I understood the question correctly) would be to change the SQL of the recordset slightly so that it's an append query. It's hard to be clearer with so little detailed information though.
Sep 20 '07 #2
jdb112
1
My guess is that mustang123 means a that recordset was created by running a query on an external database.

After creating the recordset, the connection to the external database may or may not have been closed; the point is, the recordset is now a "stand-alone" set of data: you cannot bring it to a new table by referencing the original data source.

Mustang wants to copy the records from this recordset to a separate table in Access. Seems pretty straightforward to me.

The problem is...I don't know how to do this, either. I'd like to, and that's how I found this question, by Googling "copy a recordset to a table".

Mustang, maybe some variation on this will work for you: I tried using a statement that would use the external (DB2, in my case) query as part of an INSERT command on the Access table:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [AccessTable] [SELECT blahblahblah from DB2table]
Needless to say, this hackneyed approach did not work. I'll see if I can find something else.

And for the record, I know an option is to just loop through the recordset (pulled from DB2), inserting one row at a time into the Access table. But, as mustang123 has probably found out, it's too slow. A bulk operation, if it could be finagled, would be great. I'll let you know if I find anything...

Jared
Sep 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
6
by: Geir Baardsen | last post by:
Hi! This is a routine for copying a recordset into a new order. It has worked fine under Win98. However, my client has changed to Win XP, and suddenly it doesn't work anymore. I keep getting the...
2
by: Ken | last post by:
How can I copy data from SQL to MS Access using dsn-less connection and not using SQL DTS? I have this but am stuck. I just want to do an export but can't figure out how to do a "select into". ...
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
1
by: Beowulf | last post by:
I have a report laid out in Design View as shown at the end of this message. I have code that performs the following steps: 1. In main report's Report_Open(), DELETE any old rows in tblTOC for...
5
by: paulc05 | last post by:
Hi, I have a DB on a remote share that I want to update to a local DB periodically. My plan is to create a VBA procedure and then trigger the procedure a few times a day to the process is...
4
by: Jim Devenish | last post by:
I wish to copy a table on a SQL Server backend to a table on an Access (.mdb) front end in the simplest way. I have the following to get the recordset but am seeking something easier. Dim...
2
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.