Click here to Skip to main content
15,915,703 members
Home / Discussions / Database
   

Database

 
GeneralRe: Numeric Datatype Pin
SasaT19-Nov-01 23:44
SasaT19-Nov-01 23:44 
GeneralChecking flag adFldIsNullable with Field "Attributes" property Pin
24-Oct-01 2:33
suss24-Oct-01 2:33 
GeneralSQL Query Pin
Drawil23-Oct-01 10:39
Drawil23-Oct-01 10:39 
GeneralRe: SQL Query Pin
Drawil23-Oct-01 22:07
Drawil23-Oct-01 22:07 
GeneralADO Resource pooling Pin
Alberto Richart23-Oct-01 6:20
Alberto Richart23-Oct-01 6:20 
GeneralADO BeginTrans inside a try catch block Pin
John M. Drescher22-Oct-01 6:48
John M. Drescher22-Oct-01 6:48 
GeneralRe: ADO BeginTrans inside a try catch block Pin
Wanderley M22-Oct-01 23:11
Wanderley M22-Oct-01 23:11 
GeneralRe: ADO BeginTrans inside a try catch block Pin
John M. Drescher23-Oct-01 7:14
John M. Drescher23-Oct-01 7:14 
There are several cases in my database where I need to guarantee that the data read from one ConnectionPtr is the latest data written to the database. This generally happens when I need to generate an ID for something and don't use an AutoNumber. One example of this is when I need to generate a Patient ID when the user has not entered a valid one and the case has been forcibly closed because of inactivity.

As I said in my original description, because of caching that occurs in the connection at least when using JET to gaurantee you have the latest data from one ConnectionPtr to another you have to flush then cache (on reads) and do begintrans/committrans on all writes that need to be the latest. There is a MS KB article Q200300 that explains the problem as it refers to JET, it is a couple of years old and I have no idea if it applies to MSDE also.


Below is taken from the KB article:
In certain situations you may need to use two separate ADO connections when writing and reading data from an Access database using the Jet OLEDB Provider. For example, if you have two separate processes that are writing and reading to the same Access database, there is no way to share a single connection. In this situation, you can synchronize writes and reads with separate ADO connections if you follow these guidelines:

The writer must start a transaction, using ADO's Connection.BeginTrans, prior to writing the data.

The writer must make the database updates and then commit the transaction (using ADO's Connection.CommitTrans).

The reader must call JRO.JetEngine.RefreshCache passing in it's connection prior to attempting to read the data.



GeneralRe: ADO BeginTrans inside a try catch block Pin
Wanderley M23-Oct-01 11:50
Wanderley M23-Oct-01 11:50 
GeneralRe: ADO BeginTrans inside a try catch block Pin
John M. Drescher23-Oct-01 12:34
John M. Drescher23-Oct-01 12:34 
GeneralRe: ADO BeginTrans inside a try catch block Pin
Wanderley M23-Oct-01 22:45
Wanderley M23-Oct-01 22:45 
GeneralSQL Server 7.0 SP3 and money datatype Pin
Michael Martin21-Oct-01 20:46
professionalMichael Martin21-Oct-01 20:46 
GeneralRe: SQL Server 7.0 SP3 and money datatype Pin
Wanderley M22-Oct-01 3:32
Wanderley M22-Oct-01 3:32 
GeneralRe: SQL Server 7.0 SP3 and money datatype Pin
Michael Martin22-Oct-01 15:32
professionalMichael Martin22-Oct-01 15:32 
GeneralMSDE 2000 Question Pin
John M. Drescher21-Oct-01 8:57
John M. Drescher21-Oct-01 8:57 
GeneralRe: MSDE 2000 Question Pin
John M. Drescher22-Oct-01 5:48
John M. Drescher22-Oct-01 5:48 
GeneralADO DataGrid, MS Access & Server-side cursors Pin
Jim Stim18-Oct-01 22:53
Jim Stim18-Oct-01 22:53 
GeneralRe: ADO DataGrid, MS Access & Server-side cursors Pin
Rashid Thadha21-Oct-01 22:40
Rashid Thadha21-Oct-01 22:40 
QuestionHow to age out subscribers accounts? Pin
Jason Jystad18-Oct-01 9:37
Jason Jystad18-Oct-01 9:37 
AnswerRe: How to age out subscribers accounts? Pin
Wanderley M19-Oct-01 8:42
Wanderley M19-Oct-01 8:42 
GeneralRe: How to age out subscribers accounts? Pin
Jason Jystad22-Oct-01 7:15
Jason Jystad22-Oct-01 7:15 
GeneralRe: How to age out subscribers accounts? Pin
Wanderley M22-Oct-01 7:49
Wanderley M22-Oct-01 7:49 
GeneralRe: How to age out subscribers accounts? Pin
Jason Jystad23-Oct-01 7:40
Jason Jystad23-Oct-01 7:40 
GeneralFinding duplicate records Pin
James Spibey17-Oct-01 22:39
James Spibey17-Oct-01 22:39 
GeneralRe: Finding duplicate records Pin
Wanderley M17-Oct-01 22:57
Wanderley M17-Oct-01 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.