EasyCFM.COM ColdFusion Forums / ColdFusion Applications / Quick and Dirty counter problem

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Quick and Dirty counter problem

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

dgcasey
07-21-2003 @ 8:55 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 8
Joined: Jul 2003

I am trying to implement the Quick and Dirty counter code into a couple of websites and I seem to be having a little trouble with the code.  First, the error message I'm getting:

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 (55:4) to (55:53).

Now, obviously I have a mismatched data element somewhere in this section of code:


CFQUERY NAME="TrackUser" DATASOURCE="realestate">
     insert into ClientTrack (id, RemoteAddress, RemoteHost, Referer,UserAgent, page, custno)
     values ('#user_id#', '#address#', '#host#', '#referer#', '#agent#', '#page#',
   CFIF isdefined("custno")>
     '#custno#'
   cfelse>
     ''
   /cfif>)
   /CFQUERY>
   /CFIF>


I have the database table set up with the following fields and types:

id = number
RemoteAddress = text
RemoteHost = text
Referer = text
UserAgent = text
page = text
custno = number

Now, I have the simple counter portion of the code working just fine.  But, when I try to get the more complex tracking schemes working, this is the problem I am having.

Any help would be greatly appreciated.

P.S. I know the code is missing a few < markers.  It's the only way to get it to post in this forum without being grunged.



Dave Casey
Century 21 MoneyWorld
http://www.LasVegasHomesDirect.com
http://www.lvkc.com

Webmaster
07-21-2003 @ 8:59 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Integer values do not use ' '

so change the query to look like this example:
CFQUERY NAME="TrackUser" DATASOURCE="realestate">     insert into ClientTrack (id, RemoteAddress, RemoteHost, Referer,UserAgent, page, custno)     values (#user_id#, '#address#', '#host#', '#referer#', '#agent#', '#page#',   CFIF isdefined("custno")>     #custno#   cfelse>     0   /cfif>)   /CFQUERY>   /CFIF>

Thanks,
Pablo Varando

=====================================================

dgcasey
07-21-2003 @ 9:13 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 8
Joined: Jul 2003

Pablo, I hate you man!

Wink

I should have seen that.  Works like a charm now.

Thanks man, you're just too cool.

P.S.  Glad I found your new site.  Kind of miss you over at CFM-Resources.  Keep it up.



Dave Casey
Century 21 MoneyWorld
http://www.LasVegasHomesDirect.com
http://www.lvkc.com

This message was edited by dgcasey on 7-21-03 @ 9:13 AM


Website Designed and Developed by Pablo Varando.