Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Openrecordset parameters

Posted on 1998-04-23
2
Medium Priority
?
238 Views
Last Modified: 2012-05-04
hi, there
I like to know some details example about how to use the openrecordset(parameters). In what conditions I should use dbopendynaset, table, snapshot, and forwardonly, readonly, etc.
I have read the VB help file. but I want to know some real world examples.
Could anyone give me some hints?

ny971181
0
Comment
Question by:ny971181
[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
2 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 120 total points
ID: 1428026
First of all, the dynaset, table, and snapshots.

Snapshots are for read-only recordsets.  They are quicker to load so if you don't need to edit the data, use this.

Dynasets are editable recordsets.  If you need to edit the data use this.

Tables are somewhat like dynasets, but are more limited in the methods to use (such as searching for a particular value).  It is preferred to use dynasets instead of this.

Forward only, allows for a faster loading of the recordset.  Snapshots are always opened as forward only.  If you don't need to move back and forth through the recordset, use this.

Set rsTable = dbData.OpenRecordset(sTable, dbOpenForwardOnly)
is the same as
Set rsTable = dbData.OpenRecordset(sTable, dbOpenDynaset, dbForwardOnly)

Readonly - If you open a dynaset as read-only, you are in effect opening a snapshot.

Now for examples:

To open a recordset for general uses:
  Set rsTable = dbData.OpenRecordset(sTable, dbOpenDynaset)
This will allow moving though the recordset forward and backward.  It will also allow for adding data and editing existing data.

To open a recordset for reading only, to display a list of available data, for example:
  Set rsTable = dbData.OpenRecordset(sTable, dbOpenSnapshot)
You would use this for something like loading a listbox with data, or creating a report.

If you will do nothing bu add new data to a recordset:
  Set rsTable = dbData.OpenRecordset(sTable, dbOpenDynaset, dbForwardOnly)
This will allow for adding data, but won't allow to seek an existing value.

There are many variations of the options available for OpenRecordset.  This is but a small sampling.
Might I suggest you look into one of the many books available for VB with emphesis on database programming?
0
 
LVL 1

Author Comment

by:ny971181
ID: 1428027
hi, Thank you for your detailed explanation.
That helps a lot.
I did look at some books b4, but none summarize the topic. So I lost them easily.

But thank you again.

ny971181

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

604 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