Menu

Problem of update data at MS access database

Help
2016-02-12
2016-02-16
  • Schuster Martin

    Schuster Martin - 2016-02-12

    Hello,

    I' using UcanAcess Version 3.0.3.1 and i try to update some data at a MS-Access database. I tried already many different possibilities but i cant get it to run. I don't get any exceptions but it look like that the data is not updated immidiatly. If i run my code and I've opened the table at msAccess i can't see the update. Even if i reopen the table nothing is updated. Only if i press the refresh button or if i reopen the Database the update is visible.
    One approach was the following code:

      dataConnection.getConnection().setAutoCommit(false);
    
      Statement stmt = dataConnection.getConnection().createStatement();
      stmt.execute("UPDATE Measurement SET Measurement.Comment = '" + comment + " 'WHERE Measurement.DateTimeStamp="
              + dateTimeStamp + ";");
    
      dataConnection.getConnection().commit();
    
      stmt.close();
    

    Does anybody has an idea how to solve this problem.

     
    • Gord Thompson

      Gord Thompson - 2016-02-12

      Only if i press the refresh button or if i reopen the Database [in Access] the update [made by UCanaccess] is visible.

       
      That is true. See the answer here for more information.

       

      Last edit: Gord Thompson 2016-02-12
  • Marco Amadei

    Marco Amadei - 2016-02-12

    In other words: your deduction is not correct, data are immediately updated but ms access user interface must be refreshed to see the updates.

     
  • Schuster Martin

    Schuster Martin - 2016-02-12

    ok i understand this. The originally source of the problem was: Another Client (using odbc since it is a labview application) is connecting to the mdb. And this appliction does not recognice the update. Any other workaround than the mentioned once?

     
  • Schuster Martin

    Schuster Martin - 2016-02-12

    No chance to get a workaround?

     
  • Schuster Martin

    Schuster Martin - 2016-02-12

    No chance to get a workaround?

     
  • Marco Amadei

    Marco Amadei - 2016-02-12

    Nope, the only one is the one I mentioned in my latest post, in the link here provided by Gord: open and close the odbc connection each time; so because we can't change an external behaviour, you have to change the labview application.

     

    Last edit: Marco Amadei 2016-02-12
  • Schuster Martin

    Schuster Martin - 2016-02-16

    Hello,
    i really would like to say thank you for your help. We changed already the labview application and as you said now its working.
    Thank you very much again.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.