...

View Full Version : Data Type Mismatch



Baleric
09-19-2005, 10:11 AM
hey guys im getting this error.

Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/SamDave/Pages/ShowNews.asp, line 55

this is my line 55 now.

<% cnnLogin.execute("UPDATE _news SET news_views = news_views + 1 WHERE ID = '" & request.QueryString("show") & "'") %>

Table Name = _News
Updating Into = news_VIEWS = Text


i googled the error and found nothing that would help
please help.
-baleric

glenngv
09-19-2005, 10:19 AM
Is the ID field numeric or text? If it's numeric then you should remove the single quotes.


<% cnnLogin.execute("UPDATE _news SET news_views = news_views + 1 WHERE ID = " & request.QueryString("show")) %>

But make sure the input id is numeric.


<%
dim id
id = request.QueryString("show")
if not isnumeric(id) then
response.write "Invalid id."
response.end
end if
'...
cnnLogin.execute("UPDATE _news SET news_views = news_views + 1 WHERE ID = " & id)
%>

Baleric
09-19-2005, 10:24 AM
thank u very much :) works like a charm
woot woot



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum