473,320 Members | 1,978 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,320 software developers and data experts.

reading and adding in the same recordset?

Hey folks

I'm working on a 'duplicate' function. I need to duplicate related child
records in the same subtable.

Two questions:
1. My 'db.execute' function is not working. How can I trouble shoot it? The
SQL insert syntax looks okay. However, the records don't go in. There is no
error message.

2. Can I open the same table in two different recordset objects? I need to
loop through a series of records, and then insert the values of each one
again, into the same table, but with different parent ids.

Steve Lefevre
Nov 12 '05 #1
1 1534
Hi Steve,

I have recently done something like this.

I discovered that while you can have 2 recordsets based on the same table
open at the same time, that you cannot edit/update either of them.
I was working with a multitude of tables that I was attempting to modify and
merge, and came up with the idea of creating a copy of the table to "read"
from, and then "writing" to the original.

'We cannot modify the table that we are importing because we
'have an open recordset, so I make a duplicate copy that I can
'mess around with.
DoCmd.CopyObject , strTableName & "1", acTable, strTableName

If you want all of the code I was using, please reply either here of via
e-mail.

Don

"Steve Leferve" <le********@osu.edu> wrote in message
news:c8**********@charm.magnus.acs.ohio-state.edu...
Hey folks

I'm working on a 'duplicate' function. I need to duplicate related child
records in the same subtable.

Two questions:
1. My 'db.execute' function is not working. How can I trouble shoot it? The SQL insert syntax looks okay. However, the records don't go in. There is no error message.

2. Can I open the same table in two different recordset objects? I need to
loop through a series of records, and then insert the values of each one
again, into the same table, but with different parent ids.

Steve Lefevre

Nov 12 '05 #2

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

Similar topics

0
by: Steve Z | last post by:
Some guidance por favor I started this program with the Data Form Wizard (never again). I'm pretty deep into it now, this piece of code keeps overwriting the first record in the DB: Private Sub...
1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
2
by: Robin S. | last post by:
This is an "Add product" form. The user will enter a ProductNo (catalog number), select a Product Class (from cascading combo boxes) and then click a button to create the product. When a...
8
by: JumpinJeff | last post by:
I have a form that is open with one record in the recordset. I need to add a record to that recordset, then requery the form. Ultimately, the user will --from a list on another form-- one-by-one,...
1
by: PawelR | last post by:
Hi group, Sorry my English is very little I've question about reading data from database. In sql2k I've table (50k+ records). Commerce application writing to this table same data (up to 5 records...
14
by: Karl Irvin | last post by:
While adding data to a record set, I use something like rst! = some variable rst! = some variable ...... rst! = some variable The rst! , rst! etc. are manually typed in and it gets...
5
by: joe donnelly | last post by:
I have a couple of questions about recordsets: 1. When a recordset is summoned by the code where does it actually exist and in what form...is it created in the database (data source location)...
1
damonreid
by: damonreid | last post by:
Access 2003 Microsoft Windows XP Pro Hey, I am currently pulling my hair out here. I have a Form for adding new projects to a database, the only problem is that when I close the form it doesn't...
18
omerbutt
by: omerbutt | last post by:
AJAX PROB WITH MULTIPLE RECORDS helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.