• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch i

 
smyle khanna
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have developed a program tht generated a random number n later with those
numbers i have 2 retrieve the data matchin those numbers from database but its givin the exception when i run the program:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

how 2 resolve this problem
thanks in advance
 
Joe Ess
Bartender
Posts: 9372
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by smyle khanna:

ResultSet rs=stat.executeQuery("Select * from VBques where QuestionNo='ranNumbers'");

If QuestionNo is a numeric data type you should not quote the value you are searching for in the query. The quotes make the value CHAR or VARCHAR.
[ February 03, 2004: Message edited by: Joe Ess ]
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!