Solved

Don't understand this SQL ERROR??

Posted on 2002-07-12
8
203 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

20 Experts available now in Live!

Get 1:1 Help Now