Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

autoNumber problem with MS access

 
taha khalid
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm trying to make a search bar in java that searchs through a MS access DB .. specifically in a field that holds autoNumber format variables .. the problem that I have is the variable that gets the search value from a text field (I converted it to integer to be comparable with the autoNumber ) this approach is not working but when I change the variable that gets the text field from integer to string and change the autoNumber to a string value the code works.




Please help
 
Wei Dai
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi you two I have added code tags to both of your posts, see how much nicer it looks.
For starters you can tell which quotes you have.
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AsSalaamualaikum Taha khalid:

String sql = "select ID from student_info where ID ='"+a+"'";


What is the data type of your ID column in MS Access DB?

You are using variable a with single quote(' '). So check if it Integer(Number) or string(Text).


--------
Regards
Ahmed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic