473,487 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Append ADO recordset to table

I have created a recordset built from scratch, based on data from an
external, non-database source. I want to append this recordset to a
table in an Access database without using a loop to traverse through
each record and add to the table.

Any suggestions on what I can use or do to make this possible?

Regards.

Jun 23 '06 #1
2 11973
cb22 wrote:
I have created a recordset built from scratch, based on data from an
external, non-database source. I want to append this recordset to a
table in an Access database without using a loop to traverse through
each record and add to the table.

Any suggestions on what I can use or do to make this possible?

Regards.


You can create your recordset by using a simple SQL statement such as

"SELECT * FROM TableName WHERE 1=2"

which will give you an empty recordset.

You can detach this recordset by setting its ActiveConnection property
to Nothing.

You can then add your data from the external, non-database source,
using the same methods/code/whatever that you have already created.

You can then re-attach your recordset by resetting its ActiveConnection
back to whatever it was.

You can then use UpdateBatch to add the new records.

Of course you will have to set CursorLocation, CursorType and LockType
appropriately. And there may be no advantage to detaching the
recordset, depending upon your connection, preferences and needs.

My own preference is to use a series of INSERT INTO sql statements, one
for each row of data that you are getting from your external,
non-database source. While calling many SQL INSERTs might seem clumsy
or inefficient, in fact, this method is likely to be safer and quicker
than recordset manipulation and updating.

Jun 23 '06 #2
Thanks for the suggestion Lyle!

I will consider your advice.

:-)

Jun 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4886
by: Barn Yard | last post by:
good morning, im still kind of new to VBA but I have learned some interesting things so far. Right now I am normalizing my survey database so I'm having to run an append query for each...
3
2266
by: Craig.Lee | last post by:
I am opening a text file with an ODBC connection. I want to append all the text data to a table. Going row by row and field by field takes too long. Does anyone know how I can either reference the...
1
2392
by: BrianDP | last post by:
I'm trying to duplicate the functionality of a routine that I'm updating into a new database. The old application assumes you have a filtered set of records behind a form. The form is open,...
6
1630
by: Reggie | last post by:
Hi and TIA. I have an OleDB connection to an Access db which I connect to and place data from a table into a recordset. What I want to do is copy this recordset to an SQL table. I have no...
5
2233
by: solar | last post by:
I have copied a function that appends from table orders2 into table orders1 the row that has the value SubOrder = True in the table orders2. This function finds the highest ordered in the table...
22
18761
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
7
1943
by: Henrootje | last post by:
I have to run a lot of append queries. I have data in tables in old databases that has to be appended to tables in a new database. I made a new database in which I linked the old tables and the...
1
4768
by: Jason Lepack | last post by:
I have a loop that loops through all records in all tables that have "TSE" as the first letters. In that loop, based upon conditions of the current record I have to add records to 1 of 5 different...
13
9809
by: technocraze | last post by:
Hi guys, I have an issue with incrementing a counter in a table using VB in MS Acess environment. Below mentioned is an instance. Implementation logic Table fields Serialno = pk Datatype...
0
7132
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,...
1
6846
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
7341
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
5439
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,...
1
4870
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...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.