Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ADO Recordset not showing changes just made...

ADO Recordset not showing changes just made...

Scheduled Pinned Locked Moved C / C++ / MFC
databasequestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Wolfensberger
    wrote on last edited by
    #1

    I've noticed that sometimes when saving data to a (JET) database while using ADO, a query performed right after the changes may not contain the changes....in particular if you have more than a single connection object to the same database. I've played with events to make sure that the data is actually commited to the database (the CommitTransComplete method is getting called), but haven't found any solution except to hard-code a wait which I suspect is a very very bad idea. Anyone have any ideas or know have an idea what I'm fighting against?? Thanks! Paul

    L 1 Reply Last reply
    0
    • P Paul Wolfensberger

      I've noticed that sometimes when saving data to a (JET) database while using ADO, a query performed right after the changes may not contain the changes....in particular if you have more than a single connection object to the same database. I've played with events to make sure that the data is actually commited to the database (the CommitTransComplete method is getting called), but haven't found any solution except to hard-code a wait which I suspect is a very very bad idea. Anyone have any ideas or know have an idea what I'm fighting against?? Thanks! Paul

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      my understanding is that changes are not broadcast across multiple connections as the potential traffic on the network (in a multiuser scenario) would be grim the solution we came up with was either to build in an auto-refresh every minute or two, or to give the users a refresh button on the data entry screens sql server works this way to in fact mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them

      P 1 Reply Last reply
      0
      • L l a u r e n

        my understanding is that changes are not broadcast across multiple connections as the potential traffic on the network (in a multiuser scenario) would be grim the solution we came up with was either to build in an auto-refresh every minute or two, or to give the users a refresh button on the data entry screens sql server works this way to in fact mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them

        P Offline
        P Offline
        Paul Wolfensberger
        wrote on last edited by
        #3

        The information seems to be available within a few seconds (somewhere between 2 and 4 seconds) so refreshing every minute wouldn't really help any....and I need the data within a second of having saved it to the database. I don't want to hardcode a wait into the application, and the whole point of the current set of work that I'm doing is to optimize for speed....having just saved the user 10 seconds, I'd hate to have to give half of it away waiting for data. I've come across a Q article which indicates that Jet has "lazy" writes and caches information within the connection. I've set a connection property that is suposed to make sure that transaction data is to be saved right to the file, but haven't found any way of making sure that the other connection's cache is refreshed. ;( Paul

        J 1 Reply Last reply
        0
        • P Paul Wolfensberger

          The information seems to be available within a few seconds (somewhere between 2 and 4 seconds) so refreshing every minute wouldn't really help any....and I need the data within a second of having saved it to the database. I don't want to hardcode a wait into the application, and the whole point of the current set of work that I'm doing is to optimize for speed....having just saved the user 10 seconds, I'd hate to have to give half of it away waiting for data. I've come across a Q article which indicates that Jet has "lazy" writes and caches information within the connection. I've set a connection property that is suposed to make sure that transaction data is to be saved right to the file, but haven't found any way of making sure that the other connection's cache is refreshed. ;( Paul

          J Offline
          J Offline
          John M Drescher
          wrote on last edited by
          #4

          I had the same problem a couple of months ago with an Access 2000 database and ADO. The solution looks like the following: pConnection->BeginTrans(); //modify data base in some method pConnection->CommitTrans(); After CommitTrans() other connections will see the change that occurred between BeginTrans and CommitTrans. This will flush the result back to the database. There is an article in the MSDN library that explains transactions in ADO. Search MSDN for "Using Transactions in Your Solutions" as an exact phrase. There should be one article, its in Visual Basic but the solution is similar in VC++. John

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups