Re: Commit of Record insertion Access.mdb

From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 01/24/05

  • Next message: Christoph Basedau: "Re: Jet and Batch Updates"
    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


  • Next message: Christoph Basedau: "Re: Jet and Batch Updates"

    Relevant Pages

    • Re: Requery "Too Soon"?
      ... "The database has been placed in a state by user ... then the Requery will return the just ... MsgBox appears, I get an empty subform, i.e., I do ... I'll try inserting a DoEvents or two. ...
      (microsoft.public.access.formscoding)
    • Re: SQLCE performance from .NET CF v2.0
      ... Please remember when bulk inserting is being executed against SQL CE, ... > local database functionality. ... > database technology and I am considering switching to SQLCE at the same ... > execute the prepared statement again. ...
      (microsoft.public.dotnet.framework.compactframework)
    • Re: Transforming ascii file (pseduo database) into proper database
      ... contained therein so that it can be inserted into an existing database. ... So I iterate over the file maintaining a list of calls for the given phonenumber, and when the phonenumber changes, I deal with the previous cache of data, then re-initialize with the new phone's data. ... create a temp DB, skim through the file inserting all your data into a table in this DB, then use DB functionality on it ...
      (comp.lang.python)
    • perl with mysql which takes a file as a input that contains t he info to create the tables
      ... inserting values into the database. ... only procedure for taking input from a file (using perl script) into ... MySQL database is through place holders. ... Where the passlist.txt hav the data in the format ...
      (perl.beginners)
    • perl with mysql which takes a file as a input that contains t he info to create the tables
      ... inserting values into the database. ... only procedure for taking input from a file (using perl script) into ... MySQL database is through place holders. ... Where the passlist.txt hav the data in the format ...
      (perl.beginners)