473,804 Members | 3,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1571
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.CopyObjec t , 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
4893
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 cmdAdd_Click() On Error GoTo AddErr DatPrimaryRS.Recordset.MoveLast DatPrimaryRS.Recordset.AddNew DatPrimaryRS.Recordset.Fields("Caller").Value = txtCaller.Text DatPrimaryRS.Recordset.Fields("Date").Value = txtDate.Text
1
2594
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 access the recordset it displays the results, what the real issue is that the entry is not made into the database even though i use the Update command and i have also tried the BeginTrans and CommitTrans nothign seems to work and i am unable to...
2
2519
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 product is added, a recordset (class) from a table (tblClassDetails - fields are: ClassID, SpecID) will be cloned into another table (tblClassProJoin - fields are ClassID, ProductID, SpecID and Value). Obviously, ClassID and SpecID will be cloned.
8
2096
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, add records to the forms recordset. Not new records, just other existing records that need to be displayed. It seems like this should be pretty simple. I could have the user open multiple instances of the form, and that would actually be a...
1
1532
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 per minute). My application must show new records for example in dataGrid (refresh approx once per 15 seconds - max). If I use to refresh dataSet: myDataAdapter.Fill(MyDS, "Table1"); //event onTick for Timer
14
2382
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 tedious typing a lot of these.
5
1608
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) as a new table that mimics the actual database table and contains the fields and rows asked for in the query? It is somewhat vague as to it's true nature in the materials I have rummaged through lately. 2. When an UPDATE code command is given...
1
2023
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 insert that information into the table. This is a major problem as it is suppose to use the information to populate several other tables with key information and open another form based on some of that information (in this case project number). ...
18
1983
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 decrement it to the current quantity for example if tehre is a part woth part no 10023 and its quantity in show room is 20 and total quantity is 25 then if there is a sale of 2 parts then i have to add the sale and decrement the current quantity in the...
0
9575
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
10564
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...
1
10308
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
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
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...
1
7609
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5513
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...
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.