Hello fellow ranchers, im trying to make a online bookstore work usin jsp and my database is created in MS Access 2003.Dont ask why but thats were i was told to fix the database.Anyway,im trying to insert a new customer in my register form but nothing gets inserted in my database.Here is the code for finding the max id: Statement stmt3 = con.createStatement(); ResultSet rs1 = stmt3.executeQuery("select Max(Customer_ID) from Customers;"); int maxID = Integer.parseInt(rs1.getString("Customer_ID")) + 1; and here is my insert statement: Statement stmt1 = con.createStatement(); String insertCustomer = "Insert into Customers (Customer_ID,CreditCard_ID,FirstName,LastName,E_Mail,Address,ZipCode,City,Telephone,MoreHelp) " + "Values(" + maxID + "," + maxID + ",'" + FName + "','" + LName + "','" + Email + "','" + Address + "','" + ZipCode + "','" + City + "','" + Telephone + "','" + MoreHelp +"');";
if anyone could help ill be grateful. thnx in advance.
thnx found out what was the problem.Microsoft they say. ok so this works and now i have a new problem.i get the customerid from one page to another but when i use it in an sql query i get an error : Too few parameters. Expected 1. my code that makes this error is : Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from Customers where Customer_ID = Cidd;");