Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Don't understand this SQL ERROR??

Posted on 2002-07-12
8
Medium Priority
?
209 Views
Last Modified: 2013-12-24
[Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect

Hint: The cause of this error is usually that your query contains a reference to a field which does not exist. You should verify that the fields included in your query exist and that you have specified their names correctly.


The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (61:1) to (61:40).
-----v-----v-----v-----v-----v-----v-----v-----v-----v
On this Query there is no calling to a field called COUNT?
And all of my Fields are in the database.
-----v-----v-----v-----v-----v-----v-----v-----v-----v
Query:
-----v-----v-----v-----v-----v-----v-----v-----v-----v
<cfquery datasource="#application.dsn#">
UPDATE INVENTORY
Set Description='#Description#',
PartNum='#PartNum#',SKU='#SKU#',
Mfg='#Manufacturer#',MfgNum='#ManufacturerNum#',
SellingPrice=#SellingPrice#,
Distributor='#Distributor#',DistributorNum='#DistributorNum#',
Commission=#Commission#,Commissionrebate=#Commissionrebate#,
OurPrice=#Ourcost#,
MaterialTax=#Taxable#,Category=#catid#,
AgentsCommissions=#AgentsCommissions#,
Discountable='#discounted#'
WHERE ID=#InventoryID#
</cfquery>
0
Comment
Question by:UNVME69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7149561
That it kinda strange,  On first glance the code appears to be fine and shouldn't have any problems.  Have you tried putting single quotes around all the fields except for the WHERE ID = #inventoryID#.  Try to get the query to return a different error to you and through process of elimination you'll most likely find the field that is causing the problem.
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7149565
Try it like this and see what it returns to you:

<cfquery datasource="#application.dsn#">
UPDATE INVENTORY

Set
Description = '#Description#',
PartNum = '#PartNum#',
SKU = '#SKU#',
Mfg = '#Manufacturer#',
MfgNum = '#ManufacturerNum#',
SellingPrice = '#SellingPrice#',
Distributor = '#Distributor#',
DistributorNum = '#DistributorNum#',
Commission = '#Commission#',
Commissionrebate = '#Commissionrebate#',
OurPrice = '#Ourcost#',
MaterialTax = '#Taxable#',
Category = '#catid#',
AgentsCommissions = '#AgentsCommissions#',
Discountable = '#discounted#'

WHERE ID = #InventoryID#
</cfquery>
0
 
LVL 2

Expert Comment

by:tleish
ID: 7149596
"COUNT field incorrect" is a general MS Access error.  It doesn't mean it can't find the field "COUNT", I think it means that one of the fields listed has been mispelled or doesn't exist in the table.  

In other words, the "Count" or names of the query do not match the "Count" or names in the table.  Re-check your fields in the query against the table.
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 3

Expert Comment

by:dapperry
ID: 7149656
Are you querying a table or a saved query? If the latter, you may want to check and resave the query. Sometimes, if you add a new field to an underlying table, the saved query gets messed up.

:) dapperry
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7155760
Any luck UNVME69?  Just wondering how the progress is going with your problem.
0
 
LVL 6

Accepted Solution

by:
dash420 earned 200 total points
ID: 7187447
count error is the common in the access database. This error will occurs if any fields you refering is not valid column in the table or where clause where fields is text and you are not putting ''.

so just copy sql string and put just before <cfquery> tag.

like

<cfoutput>

UPDATE INVENTORY
Set Description='#Description#',
PartNum='#PartNum#',SKU='#SKU#',
Mfg='#Manufacturer#',MfgNum='#ManufacturerNum#',
SellingPrice=#SellingPrice#,
Distributor='#Distributor#',DistributorNum='#DistributorNum#',
Commission=#Commission#,Commissionrebate=#Commissionrebate#,
OurPrice=#Ourcost#,
MaterialTax=#Taxable#,Category=#catid#,
AgentsCommissions=#AgentsCommissions#,
Discountable='#discounted#'
WHERE ID=#InventoryID#
</cfoutput>


<cfquery datasource="#application.dsn#">
UPDATE INVENTORY
Set Description='#Description#',
PartNum='#PartNum#',SKU='#SKU#',
Mfg='#Manufacturer#',MfgNum='#ManufacturerNum#',
SellingPrice=#SellingPrice#,
Distributor='#Distributor#',DistributorNum='#DistributorNum#',
Commission=#Commission#,Commissionrebate=#Commissionrebate#,
OurPrice=#Ourcost#,
MaterialTax=#Taxable#,Category=#catid#,
AgentsCommissions=#AgentsCommissions#,
Discountable='#discounted#'
WHERE ID=#InventoryID#
</cfquery>

then launch the site. so the string within the cfoutput will print on the browser. run these sql string directly on the access query. you will get the what is the exact error.
0
 

Author Comment

by:UNVME69
ID: 7190951
Gotcha thanks
0
 
LVL 6

Expert Comment

by:dash420
ID: 7192432
thanks
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question