PDA

View Full Version : ASP : mismatch?



imported_dinkumrocks
April 7th, 2005, 12:47 PM
Ok.

through my whole "journey" of building my web app with asp, you guys have answered my question. i wanna say thanks.

but i have another question, and ill prolly have more.


OK. i get this error...




Microsoft OLE DB Provider for ODBC Driverserror '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. /community/news_comment.asp, line 47



and this is the code that causes the error.

<%set RScomments = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM comments WHERE storyid=" & Request.QueryString("storyid") & ""
RScomments.Open strSQL, Conn
RScomments.MoveFirst()
If not RScomments.eof then
while Not RScomments.eof
%>
<div class="asset"><span class="newstitle"><%= RScomments("item_title")%></span>
<br><%= RScomments("item_when")%> <strong>- by</strong> <%= RScomments("item_user")%><br><br>
<%= RScomments("item_body")%></div>
</div>
<%RScomments.movenext
wend
else
Response.write "There are no comments right now."
end if
%>


line 47 is where the recordset is opened.

i dont know whats causing this error, tahts why i came here :)

Edit:// the querysting "storyid" is an integer, just incase you were wondering :)

Thanks for anyhelp,
-Naaman

abcdefg
April 7th, 2005, 03:47 PM
Its been my experience that you get that error, when you're referring to the your field names with the wrong name.

imported_dinkumrocks
April 7th, 2005, 06:04 PM
i checked the field names over and over and they all exist.

thanks for anyehelp,
Naaman