Solved

Don't understand this SQL ERROR??

Posted on 2002-07-12
8
206 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
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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 
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 50 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reverse Proxy Server 6 91
How can I install php on a ngxin server on droplet 5 142
System Analysis 5 62
move expression web site to a new server 13 54
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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