Solved

Write only dao recordset

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format a text field as percent 12 56
Access vs Access runtime 6 63
Combo box question 6 54
How to create and use encrypted columns in SQL 2005? 15 62
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

734 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