Solved

Write only dao recordset

Posted on 2001-07-29
5
344 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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

688 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