Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get rid of this error.. tried everything :/ Err&Code included,

Status
Not open for further replies.

bboehle

Programmer
Aug 22, 2000
24
US
I've never gotten this error and i've looked over my code 100 times and I can't find anything wrong :/ My code is pasted below :/


Error Diagnostic Information
ODBC Error Code = 22005 (Error in assignment)


[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.



The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (1:1) to (5:1).


Date/Time: 11/04/00 19:34:06
Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)
Remote Address: 10.137.13.225
HTTP Referer: Query String: &ItemID=6
---------
<CFQUERY
DATASOURCE=&quot;Ashli&quot;
NAME=&quot;delmagicverify&quot;>
SELECT
ItemID,
ItemName,
ItemCharges,
Price,
AddedBy,
DateAdded
FROM Magic
WHERE AddedBy='#Form.AddedBy#'
ORDER BY ItemName
</CFQUERY>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<LINK REL=&quot;StyleSheet&quot; TYPE=&quot;text/css&quot; HREF=&quot;ashli.css&quot;>
<CFIF delmagicverify.RECORDCOUNT EQ &quot;0&quot;>
<P>I'm sorry but there doesn't seem to be a Item up for sale by you. Please go back to the verify you typed your name correctly...
<CFELSE>
<P>Select the item you would like to remove?<BR>
<CFOUTPUT QUERY=&quot;delmagicverify&quot;>
<A HREF=&quot;dlmagicview.cfm?&ItemID=#ItemID#&quot;>#ItemName#</A><BR>
</CFOUTPUT>
</CFIF>
</BODY>
</HTML>
 
It seems that your WHERE clause's expression value is not enclosed with CFOUTPUT tags.

Try changing to WHERE clause to...

WHERE AddedBy='<CFOUTPUT>#Form.AddedBy#</CFOUTPUT>'


Hope this works.

Klotzki
 
What kind of values does the AddedBy field contain. I would assume it contains a text value, but if it contains a number then the error message makes more sense. For instance if you have a table of people and each person is assigned a unique ID and then that ID number is inserted into Magic as AddedBy, you would definately get this error.
Hope this helps.

bankholdup
 
I've never had to put CFOUTPUT tags in my WHERE clause before when pulling somthing from a form or the url but i'll give it a shot..

Bank your on the train of thought I was on.. My Access 2000 Database is set up lik this:
ItemID-AutoNumber-PrimaryKey
ItemName-Text-Indexable
ItemCharges-Text-Indexable
Price-Text-Indexable
AddedBy-Text-Indexable
DateAdded-Text-Indexable..

Now when I first started I hade the ItemCharges, Price, labled as long integer instead of Text and the Date Added as Short Date.. When I got that data mismatch I tried changing the Date to text date to long integer, and the long integers to text.. All of which resulted in the same error.

My code previous to this one is a 1 field form where they put in thier name.. that in turn pulls up all the itmes they currenty have up for sale. When they click on the item they would like to remove it takes the to the code posted above with the error.

I'll try the cfouput tag inside my query and let you know what happens in a few.
 
CFOUTPUT inside the CFQUERY on the WHERE clause doesn't work.. I'm thinking it can't even process an output clause that's inside the cfquery because the query isn't even over yet to allow a cfoutput to have info to ouptput :) I may be wrong though.

I get the same error..

Any other ideas?

Brandon
 
Try outputting the value of #form.addedby# to the new page, before doing anything else, make sure it is getting an appropriate value.

bankholdup
 
I took the where clause out and just put the form.addedby inside the cfoutput tag.. it gets the correct data.

I don't think the problem is with the addedby because it displays the page fine.. the items by the person's name that was entered on the previous screen.. it's when they click on the item they want to delete that links and passes a string via url that this error occurs :/

Thanks for the help so far.. look forward to seeeing what else you got in mind :)
 
Could you email the pages involved? It's a lot eaiser to look at all the code in one shot. Just email it to bank_holdup@yahoo.com.

bankholdup
 
Please post the solution that you guys come up with cuz I'm having the same problem.
 
Well, the mystery is solved. the problem was actually varible on the preceeding page. It was a number type, but bboehle had it in ''. Which caused the data mismatch error.
Micah, take a look at all your variables in the where part of your query and make sure that anything that isn't specifically a number is enclosed in ''. Remember, dates of the date/time format are NOT numbers and must be ''.

Good luck Micah.

bankholdup
 
<A HREF=&quot;dlmagicview.cfm?&ItemID=#ItemID#&quot;>#ItemName#</A><BR>

there is an & in the URL that shouldn't be there...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top