Solved

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

Posted on 2002-07-09
2
1,348 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
[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 5

Accepted Solution

by:
TheMek earned 25 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

Independent Software Vendors: 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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

756 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