Re: Commit of Record insertion Access.mdb
From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 01/24/05
- Previous message: Stephen Howe: "Re: Fields not longer available when subclassing the _RecordsetPtr cla"
- In reply to: Marc Doolittle: "Commit of Record insertion Access.mdb"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 Jan 2005 19:47:07 -0000
> GetCountRecords just fills a dataset object with a DataAdapter to return a
> count from the Access database of the recently inserted records. The code
> is not important I don't thnk- I have changed it 1000 differnet ways and
> still get this problem- My problem-
>
> 1/10 to 1/2 of the time (randomly) the GetCount procedure returns 0
records
> inserted when in fact there were records inserted. If I put a breakpoint
in
> the da.fill(ds) line that fills the dataset in debug it always returns a
> number of records but running the exe it occasionally returns 0. Each
> procedure has a separate connection to the database. I have tried multiple
> ways to correct this problem. Using transactions, using Datasets to update
> the records versus inserting with an SQL command, using DataReaders rather
> than filling a dataset. Disposing, forcing garbage collection. The only
fix
> so far is to put a thread.currentthread.sleep(10000) before the GetCount
> procedure. In other words for some reason (threading? Garbage Collecting?)
> ADO.net needs to "Wait" until the correct count will return. This solution
> is inadequate. Any ideas? Marc
I think this is Access. See these articles as they are related
http://support.microsoft.com/kb/291238/EN-US/
http://support.microsoft.com/kb/245676/EN-US/
The rows are not immediately part of the database not until the cache is
emptied.
Hence your results.
Stephen Howe
- Previous message: Stephen Howe: "Re: Fields not longer available when subclassing the _RecordsetPtr cla"
- In reply to: Marc Doolittle: "Commit of Record insertion Access.mdb"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|