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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

?? Data type mismatch in criteria expression. ??

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
I can't seem to get this to work? I have used this this same on other pages but this one isnt working any suggestions?
Code:
<%
ConnString = &quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=&quot; & Server.MapPath(&quot;db.mdb&quot;)

set my_conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
set rs = Server.CreateObject(&quot;ADODB.RecordSet&quot;)

my_conn.Open ConnString



strID = CStr(Request.Querystring(&quot;article_id&quot;))

StrSQL = &quot;SELECT * FROM articles WHERE article_id=&quot; & &quot;'&quot; & strID & &quot;'&quot;


rs = my_conn.execute(StrSQL)  '# <ERRORS HERE


'set my_conn = nothing
my_conn.Close
set my_conn = nothing
set rs=nothing

%>


Error:

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/rate/view_article.asp, line 45

Thanks for any help.

Jason
 
is it possible that article_id is not a string type?
Griff
[Reading]
 
Even like this I get the same error:

StrSQL = &quot;SELECT * FROM articles WHERE article_id=&quot; & &quot;'&quot; & Request.QueryString(&quot;article_id&quot;) & &quot;'&quot;
 
If article_id is not a string strID must not be surrounded by quotes.


StrSQL = &quot;SELECT * FROM articles WHERE article_id=&quot; & strID

&quot;The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top