Hey guys I have been working on making a form that updates a Microsoft Access database and I cannot seem to figure out the root of this error I continue to receive.
My edit form upon loading displays the information for a selected item. There is a submit button that updates the database with all changes. I have been using preparedStatements to update my database and I have 8 parameters for my first command, however, only 3 of the parameters are recognized. I have checked the SQL statement repeatedly in Access and have determined that it is not the cause.
My code goes as follows:
preparedStatement contactUpdate = "Update tblContact Set FirstName = '?', LastName = '?', Suffix= '?', DOB = '?',Address = ?...(other inserts)... Where contactID = ?";
contactUpdate.setString(1,"Jimbo");
contactUpdate.setString(2,"Delacroix");
contactUpdate.setString(3,"III");
contactUpdate.setDate(4,Date);
//Error right here on the next line.
contactUpdate.setInt(5, 32);
contactUpdate.setString(6,"Jimbo");
contactUpdate.setString(7,"Jimbo");
contactUpdate.setString(8, 1);
contactUpdate.execute();
If you have any suggestions please let me know.
My edit form upon loading displays the information for a selected item. There is a submit button that updates the database with all changes. I have been using preparedStatements to update my database and I have 8 parameters for my first command, however, only 3 of the parameters are recognized. I have checked the SQL statement repeatedly in Access and have determined that it is not the cause.
My code goes as follows:
preparedStatement contactUpdate = "Update tblContact Set FirstName = '?', LastName = '?', Suffix= '?', DOB = '?',Address = ?...(other inserts)... Where contactID = ?";
contactUpdate.setString(1,"Jimbo");
contactUpdate.setString(2,"Delacroix");
contactUpdate.setString(3,"III");
contactUpdate.setDate(4,Date);
//Error right here on the next line.
contactUpdate.setInt(5, 32);
contactUpdate.setString(6,"Jimbo");
contactUpdate.setString(7,"Jimbo");
contactUpdate.setString(8, 1);
contactUpdate.execute();
If you have any suggestions please let me know.