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{}
}