• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

COUNT Field Incorrect

I'm creating JSP's in which I can add/update/delete a record. It worked successfully for the first file Brand, but when I try to use that file and configure it for Category - it doesn't work and the console says that I have a:

SQLException: [ODBC Microsoft Access Driver] COUNT field incorrect

I searched in some old questions, and it said that a possibility was that perhaps field names are misspelled, but I double checked that and they are all spelled correctly. What could be the other possibilities?

I am using JSP w/MS Access DB and testing it on Apache Tomcat 4.0

Thanks.
0
dudette366
Asked:
dudette366
  • 8
  • 2
  • 2
  • +1
1 Solution
 
TheAmigoCommented:
Can you post a copy of your SQL string?
0
 
dudette366Author Commented:
SELECT m.materialID, m.materialName FROM tblMaterial m WHERE m.materialID = ? ORDER BY m.materialName"

Oops sorry.. it's Material table not Category that's what I meant to type earlier
0
 
dudette366Author Commented:
SELECT m.materialID, m.materialName FROM tblMaterial m WHERE m.materialID = ? ORDER BY m.materialName"

Oops sorry.. it's Material table not Category that's what I meant to type earlier
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
TheAmigoCommented:
Looks like a stray "m" before the WHERE.
0
 
TheMekCommented:
That's an alias TheAmigo. Shouldn't be a problem, but you might want to check if the odbc driver has a problem with aliases by removing all references to the alias m.
0
 
dudette366Author Commented:
it should be a problem with aliases b/c i used it on another file and it worked with no problem. could it be anything else? b/c i haven't spelled anything incorrectly so I can't understand why it is giving me the error
0
 
dudette366Author Commented:
it should be a problem with aliases b/c i used it on another file and it worked with no problem. could it be anything else? b/c i haven't spelled anything incorrectly so I can't understand why it is giving me the error
0
 
dudette366Author Commented:
it should be a problem with aliases b/c i used it on another file and it worked with no problem. could it be anything else? b/c i haven't spelled anything incorrectly so I can't understand why it is giving me the error
0
 
TheMekCommented:
if you output the built-up sql string and try to run that on the access database directly, does it work?
0
 
nexusnationCommented:
Hi dudette366,
This question has been abandoned and needs to be finalized (101 days since last comment).

   You can accept an answer, split the points, or get a refund. Go to
   http://www.cityofangels.com/Experts/Closing.htm for information and options.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

nexusnation
EE Cleanup Volunteer for Microsoft Access
0
 
dudette366Author Commented:
I fixed the SQL statement as I had a typo.
0
 
nexusnationCommented:
see http://www.cityofangels.com/Experts/Closing.htm#4 to close this Q yourself then.
0
 
dudette366Author Commented:
SELECT m.materialID, m.materialName FROM tblMaterial m WHERE m.materialID = ? ORDER BY m.materialName"

works. In my result set, I was requesting a field that wasn't included in the SQL statement which resolved the problem.
0
 
dudette366Author Commented:
sorry for the confusion. what happened was - I had a typo in my java code which was requesting a field that I wasn't including in my SQL statement. so actually my sql statement was fine and my java was wrong which i corrected. sorry for all the confusion
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now