Menu

Warning for Accessing MS Access 2007

Help
2016-07-18
2016-08-09
  • kiran kumar sunkara

    I am getting this warning when trying to execute my java class

    WARNING:You shouldn't use 'user' reserved word as column name in the table WIP (it refers to the database user).
    Escape it in your SQL!
    (e.g. SELECT [USER] FROM TABLE WHERE [USER]='Joe')
    Got an exception!
    UCAExc:::3.0.6 null

    What should I do?
    Thanks.

     
  • Gord Thompson

    Gord Thompson - 2016-07-18

    What should I do?

     
    Well, if you have an SQL statement that contains a column name that is some variation of user that is not enclosed in square brackets then you should... umm... enclose it in square brackets, just like the warning says.

    Maybe if you show us the relevant code you are trying to use to execute the SQL statement perhaps we can offer more specific advice.

     

    Last edit: Gord Thompson 2016-07-18
  • kiran kumar sunkara

    I am just connecting to MS Access by pointing towards .mdb file. I have a mdb file of 120 tables out of which 12 tables has the 'user' as column name. As the whole database is designed long time ago, I cannot change it. how can I ignore the warnings and proceed futher, btw thanks for the reply.

     
  • Natarajan Chidhambharam

    I'm facing the same issue. I'm trying to execute the below code to check if I'm able to connect to my database.
    Note: I'm running this on a Linux machine

    import java.sql.Connection;
    import java.sql.DriverManager;
    
    public class test {
    public static void main(String[] args) {
        Connection connection = null;
        Long t0 = System.nanoTime();
        try 
        {
            String msAccDB = "/work/users/natarajan/test.accdb";
            String dbURL = "jdbc:ucanaccess://" + msAccDB;
    
            connection = DriverManager.getConnection(dbURL);
            System.out.printf("Database opened in %.3f seconds%n", 
                    (System.nanoTime() - t0) / 1000000000.0);
        } 
        catch (Exception e) {
            e.printStackTrace(System.err);
        }
    }
    }
    

    The code runs for a really long time and comes to a halt finally. Below is my output.

    WARNING:You shouldn't use 'user' reserved word as column name in the table Email_Event_Recipients (it refers to the database user).
    Escape it in your SQL!
    (e.g. SELECT [USER] FROM TABLE WHERE [USER]='Joe')
    WARNING:You shouldn't use 'user' reserved word as column name in the table Users (it refers to the database user).
    Escape it in your SQL!
    (e.g. SELECT [USER] FROM TABLE WHERE [USER]='Joe')
    WARNING:Unknown expression: GenUniqueID() (default value of column Counter table Cover)
    WARNING:Unknown expression: GenUniqueID() (default value of column Counter table Users)
    Database opened in 1733.578 seconds

    For opening the database, it takes close to 30 mins! the db size is 200 MB. Can you please help

     

    Last edit: Natarajan Chidhambharam 2017-10-31
    • Gord Thompson

      Gord Thompson - 2017-11-01

      The "user" warning and the hang on opening the database are most likely two separate issues. You may want to start a new thread.

       

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.