Solved

Don't understand this SQL ERROR??

Posted on 2002-07-12
8
204 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
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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 camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now