Solved

Don't understand this SQL ERROR??

Posted on 2002-07-12
8
205 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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