Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Write only dao recordset

Posted on 2001-07-29
5
Medium Priority
?
355 Views
Last Modified: 2012-08-13
I have a dao recordset with over 100 thousand records in it.  I don't need to read or edit these records in my recordset I only wish to add new records.  I think a lot of time is wasted when I run this recordset because it loads so many records.

How can I initiate my recordset so that it loads no records?
0
Comment
Question by:billy21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 6

Author Comment

by:billy21
ID: 6330853
I tried using dbappendonly but it for some reason wont let me add new records using .addnew
0
 
LVL 12

Accepted Solution

by:
Paurths earned 400 total points
ID: 6330919
hi

did u use the correct syntax?
using only 'dbAppendOnly' wont work. U have to use it in combination wit a cursor.

Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim strsql As String

    strsql = "select * from YourTable;"
    Set db = CurrentDb
    Set rst = db.OpenRecordset(strsql, dbOpenDynaset, dbAppendOnly)
   
      rst.AddNew
      rst![SomeField] = "Hello There"
      rst.Update

    rst.Close
    Set rst = Nothing
    db.Close
    Set db = Nothing



cheers
Ricky
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6330922
this will only load the tablestructure and no records
--> u can try it by moving to the first record and displaying it - it wont work.

So u can only append data to it.

cheers
Ricky
0
 
LVL 6

Author Comment

by:billy21
ID: 6330939
Worked like a charm.

Thanks
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6332365
strange,
i only received email-notif 10 minutes ago...

thanx for the 'A'-grade, billy21,

c u later,
Ricky
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question