This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sqlException  RSS feed

 
kelly devon
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

someone help me out here i am trying to update using my gui
an access database and i keep getting an SQLException which
says "SQLException too few parameters expected1"
and this is the line of code doing this
correction are welcomed thanks
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kelly,
With the exception it looks like the parameters you r passing are less as compared to what the query expects.

In the query
stat.executeupdate("UPDATE Stock"+"SET Qty(dbfieldname)="+ quantity(variable)+" "+WHERE Itemsno(dbfieldname)='"item+"'");


quantity(variable) is a field i guess which u r picking from GUI.
so it too must be in single quotes .

stat.executeupdate("UPDATE Stock"+"SET Qty(dbfieldname)='"+ quantity(variable)+"'"+WHERE Itemsno(dbfieldname)='"item+"'");

try this out

thanks,
Rajendar
 
kelly devon
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!