Solved

Write only dao recordset

Posted on 2001-07-29
5
326 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
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

825 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