Solved

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

Posted on 2002-07-09
2
1,239 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 25 total points
Comment Utility
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
Comment Utility
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now