Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

diffrence between dynaset (0) <- default and dynaset (1) inconsistent updating ?

Posted on 2002-07-09
2
Medium Priority
?
1,481 Views
Last Modified: 2008-02-01
Hi there,

i had this little database where i had table articles now the type of the recordset was always set to dynaset (0), the default value. Now today i added a new table named options where i would save some values in like for example the course of the euro wich i could then use to calculate automaticly how much the prize in Belgian francs would be using the the value in the table options. Now this table (options) aint got any relation to the table articles (i aint goana put for each article what eurocourse to take since it's always the same) and since the moment i added the table to some of my queries for the recordsource i couldn't change any values anymore unless i change the type of recordset to dynaset (1) inconsistent updating i could change the data again.

But i'm not quite sure why i had to do this and what effect this have on the whole db, i mean is it ok that i changed and won't i get any troubles later on ? the help file didn't explain me much
thanks
0
Comment
Question by:joyrider
2 Comments
 
LVL 5

Accepted Solution

by:
TheMek earned 75 total points
ID: 7140407
Hi Joyrider,

can't really say much about it, but I found this info about inconsistent updates:
Inconsistent Updates
Dynaset-type Recordset objects can be based on a multiple-table query containing tables with a one-to-many relationship. For example, suppose you want to create a multiple-table query that combines fields from the Orders and Order Details tables. Generally speaking, you can’t change values in the Orders table because it’s on the “one” side of the relationship. Depending on your application, however, you may want to be able to make changes to the Orders table. To make it possible to freely change the values on the “one” side of a one-to-many relationship, use the dbInconsistent constant of the OpenRecordset method to create an inconsistent dynaset. For example:

Set rstTotalSales = dbs.OpenRecordset("Sales Totals" ,, _ dbInconsistent)

When you update an inconsistent dynaset, you can easily destroy the referential integrity of the data in the dynaset. You must take care to understand how the data is related across the one-to-many relationship and to update the values on both sides in a way that preserves data integrity.

The dbInconsistent constant is available only for dynaset-type Recordset objects. It’s ignored for table-, snapshot-, and forward-only-type Recordset objects, but no compile or run-time error is returned if the dbInconsistent constant is used with those types of Recordset objects.

Even with an inconsistent Recordset, some fields may not be updatable. For example, you can’t change the value of an AutoNumber field, and a Recordset based on certain linked tables may not be updatable.


On the other hand, you might consider storing the exchange rate as a 'global' variable in your application. Make a function around this constant to be able to use it in your queries. That way you won't have to use a separate table in your query. In a global module put:

Private Const cEuro As Double = 2.20371 'put your exchange rate here
Public Function ExchRate() As Double
  ExchRate = cEuro
End Function

Hope this helps,
  Erwin
0
 

Author Comment

by:joyrider
ID: 7140422
hmm so it is possible thatr i can destroy the whole thing then hmm, at first i did it using dlookup but that was slow, and the reason i've put it in a table was so that the user could change the rate in case it would change wich is possible with money values. So making it a global constant won't let user change the value for the course of the euro.

i've tested some it a bit with the inconsistent dynaset and it seems it doesn't screw things so i'll keep it like that, thanks for ure answer !
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

885 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