Warning: Looking for usage map at page 1774, but page type is 1 in UCanAccess

核能气质少年 提交于 2019-11-28 10:40:18

问题


When trying to run a program that interfaces with Access 2010 it throws the error

WARNING:Looking for usage map at page 1774, but page type is 1

and then proceeds to throw errors about user lacks privilege to access the table I'm trying to use.

This program seems to work perfectly fine when using Access 2013, and it worked once on Access 2010 when I tried the update statement for the first time. Now it doesn't work at all.

I can't seem to find any reference to this error anywhere online, so I'm hoping someone else has encountered it before.

It throws an error on this line of code, which it doesn't do when interfacing with Access 2013:

ResultSet rSet = stmt.executeQuery("Select * FROM Players");

The entire method is:

 public int addPlayer(String name, int x) throws SQLException //drafts a person to team x (ownerID)
, ClassNotFoundException
    {
    //Database db = new DatabaseBuilder().setCodecProvider(new CryptCodecProvider()).open(new File("BBFBLMasterVersion3.accdb"));
    Connection con;
    try 
    {
        Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
        con = DriverManager.getConnection("jdbc:ucanaccess://C:/Users/Andrew/Dropbox/Public/Schoolwork/IRC/BBFBLMasterVersion3.accdb"); //name of ODBC driver
        Statement stmt = con.createStatement();
        //stmt.executeQuery("SELECT * FROM DraftNightQuery");
        //ResultSet rSet = stmt.getResultSet();
        ResultSet rSet = stmt.executeQuery("Select * FROM Players");
        String[] split = name.split(" "); 
        String salary = "1";
        while(rSet.next())
        {   
            String lastName = rSet.getString("Last");
            //int x = Integer.parseInt(salary);
            if(split[0].toLowerCase().equalsIgnoreCase(lastName))
            {
                String firstName = rSet.getString("First"); //get the item from column named Team Name
                if(split[1].toLowerCase().equalsIgnoreCase(firstName))
                {
                    Statement connec = con.createStatement();
                    Statement idMatch = con.createStatement();
                    String id = rSet.getString("ID");
                    connec.executeUpdate("UPDATE Players SET OwnerID = "+x+" WHERE Last ='"+split[0]+"' AND First='"+split[1]+"' ");
                    //stmt.executeUpdate(whoToAdd);
                    ResultSet temp =idMatch.executeQuery("SELECT * FROM Salaries WHERE ID ='"+id+"'");
                    while(temp.next()){
                        String tempID = rSet.getString("ID");
                        if(id.toLowerCase().equalsIgnoreCase(tempID)){
                            salary = temp.getString("Salary");
                        }
                    }   
                    con.close();
                    connec.close();
                    stmt.close();
                    idMatch.close();
                    return Integer.parseInt(salary);
                }
            }
        }
        return 1;
    }
    finally{}
}

回答1:


As Gord said, the problem is detected and logged by jackcess and it's likely caused by a accdb file corruption (I would try to fix it with the Compact and repair Access tool). Also, it may be in turn caused by its use in a sync dropbox folder. Thus, that the file was modified via UCanAccess or in another way is irrelevant, because all happened at a lower layer. Please, find similar issues reported in the jackcess forum (yes, they are googlable, did you remove the page number?)



来源:https://stackoverflow.com/questions/28463234/warning-looking-for-usage-map-at-page-1774-but-page-type-is-1-in-ucanaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!