|
-
Mar 31st, 2006, 02:22 PM
#1
Thread Starter
Lively Member
Access 2003 VBA
Can someone please help me with a simple question -
I'm using a DAO connection in an Access database. I want to simply add some new records that are coming in from a table. I'm using the following commands:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Dim str As String
str = "select * from Mytable" - I don't think this is necessary????
Set rs = db.OpenRecordset(str) ?????
With rs
.AddNew
!batch = PTbl
!Item = PSrCnt
.Update
End With
I just want to add records to a table. Mytable has thousands of records and this routine is taking 30 seconds to add 4 records. I don't need to select all the records in Mytable but I don't know what code to use. Thank you.
-
Mar 31st, 2006, 02:48 PM
#2
Re: Access 2003 VBA
MAB
You would be much better served by using an ADO connection and passing your inserts into a command object
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Mar 31st, 2006, 02:53 PM
#3
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|