473,766 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ 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 12018
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 ActiveConnectio n 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 ActiveConnectio n
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
4921
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 question(300 in some surveys). WARNING: I've very new at this so this may not look right. i hope it gives the idea of what I'm trying to accomplish. Before I was just chaning the 1's to 2's then to 3's in the Design view of my query. hope this can save...
3
2275
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 text recordset in an append query or I'd be happy if I could do a maketable to a temp table and base a SQL from that? Thanks for your advice.
1
2414
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, with the filtered recordset. Next it copies a clone of the form's recordset into a table with one field (Customer) so it can use this as a join table to print from. I was able to re-write the loop and get it to work, but it sure seems like it'd...
6
1648
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 problem connecting to the SQL table but can't figure out how to pump the data from the recordset into the table. Was wondering how to do it and what would be the fastest procedure. The recordset usually consist of 20 to 100K records. Thanks very much...
5
2254
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 orders2. But I want to find the highest ordered in the table orders2 instead. In short, I want to append the order from the table orders2 into the table orders1 and this order to get the next highest ordered.Somehow I canot manage it.Can you help...
22
18811
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. The system is client/server, multiusers based. The MDBs are using record locking. Here is part of the code: Dim wkSpace As Workspace, db As Database Dim rstTrans As DAO.Recordset Set wkSpace = DBEngine.Workspaces(0)
7
1977
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 new tables. Such would look like this: Old table: tblQGBB1 New Table: tblQGBB21 Table tblQGBB21 should be emptied if filled
1
4785
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 table. Now is it quicker to use 5 recordsets and add a new record to them, or is it faster to use append statements to append the records. ex. for each t in db.tabledefs if t.name like "tse*" then
13
9842
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 text StudentId Text Course Text
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8835
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5279
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.