当尝试运行与 Access 2010 接口的程序时,它会引发错误
WARNING:Looking for usage map at page 1774, but page type is 1
然后继续抛出有关user lacks privilege
访问我尝试使用的表的错误。
该程序在使用 Access 2013 时似乎运行良好,当我第一次尝试更新语句时,它在 Access 2010 上运行过一次。现在它根本不起作用。
我似乎在网上的任何地方都找不到对这个错误的任何引用,所以我希望其他人以前也遇到过。
它在这行代码中引发错误,在与 Access 2013 交互时不会这样做:
ResultSet rSet = stmt.executeQuery("Select * FROM Players");
整个方法是:
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{}
}