Solved

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

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

770 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