Menu

How to update Yes/No column in using prepared statement?

Help
2019-08-23
2019-08-23
  • Andrew Tamon

    Andrew Tamon - 2019-08-23

    I was trying to update a column in my access that is yes/no type.
    i was trying to set it as query 1 or -1 i also tried to set it as boolean true but have no effect, no error was been detected.

     
  • Gord Thompson

    Gord Thompson - 2019-08-23

    This works fine in UCanAccess 4.0.4:

    String sql = "UPDATE Table1 SET yesnoField=? WHERE id=1";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setBoolean(1, true);
    ps.executeUpdate();
    
     
    👍
    1
  • Andrew Tamon

    Andrew Tamon - 2019-08-23

    thank you very much it did work.

     

    Last edit: Andrew Tamon 2019-08-23

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.