• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

an access database problem

 
Pierre Guersley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
it's my first time here, and i'd like to know if someone has met that error??
count field incorrect with an ms-access db using preparedStatement. here it is:
String get="SELECT * FROM FAQS WHERE ID=?";
String put="INSERT INTO FAQS VALUES (?, ?, ?, ?)";
//String put="INSERT INTO FAQS VALUES (NEXTVAL('faqid_seq'), ?, ?, ?)";
String rem="DELETE FROM FAQS WHERE ID=?";
String upd="UPDATE FAQS SET QUESTION=?, ANSWER=?, MODIFIED=? WHERE ID=?";
String all="SELECT * FROM FAQS ORDER BY ID";
it doesn't take the insert instruction any help would be very appreciated
thanks in advance
Pierre
 
Praveen Balaji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you clarify that one. How exactly are you trying to create the statements using the prepared statement? can you include the piece of code?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
keywords = Access, insert, sounds like this problem , or might be a place to start
Dave.
 
Pierre Guersley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys, but i have solved the problem!!! by the way, the same question has been asked in April without no answer. the solution is: the number of quotation marks you have in your insert or update preparedStatement have to match the number of fields in the executeUpdate instruction. The problem is , we don't always think of that.
Once again thanks, your forum is a good idea, if i can help, i'll be happy to do so in the future!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic