Menu

net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.2 user lacks privilege or object not found Error

Help
2017-12-07
2017-12-08
  • Michael Schwamborn

    I don't understand why I am getting this error Exception in thread "main" net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.2 user lacks privilege or object not found: MICHAEL

    My code is:

    String name = "Michael";
            rs = s.executeQuery("SELECT [FirstName], [LastName] FROM ["+DBTableName+"] WHERE [FirstName]="+name);
             ["+DBTableName+"] WHERE [FirstName]="+ name);
                rs.next();
                table.addCell(rs.getString(1));
                table.addCell(rs.getString(2));
                while (rs.next()) {
                    table.addCell(rs.getString(1));
                    table.addCell(rs.getString(2));
                    }
    

    Thanks!

     

    Last edit: Michael Schwamborn 2017-12-07
  • Marco Amadei

    Marco Amadei - 2017-12-07

    The sql is malformed: name should be enclosed between quotes
    ....WHERE [FirstName]='"+ name+"'")

     
    • Michael Schwamborn

      Thanks!

       

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.