By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

datatype mismatch error

P: 28
I m havin an error of datatype mismatch
actual here i m askin user to input the code in text box and then searchin the
record havin that code in database
the problem is the code field Bnum is of number datatype
so its showin me this error
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/library/12updbook1.asp, line 128



<%


bc=request.form("txtbc")
response.Cookies("bn")=bc

set con=server.CreateObject("ADODB.connection")
con.open "File Name=C:\Inetpub\wwwroot\library\mylink.udl"


set rsa=server.CreateObject("ADODB.recordset")
rsa.open "select * from Book where Bnum='"&bc&"'",con

if rsa.eof then response.Redirect("12updbook3.asp")


%>
Mar 3 '08 #1
Share this Question
Share on Google+
2 Replies


DrBunchman
Expert 100+
P: 979
Hi chirag,

Does it work if you put an integer into the input? Are you validating the input field at all?

Dr B
Mar 3 '08 #2

P: 28
Hi chirag,

Does it work if you put an integer into the input? Are you validating the input field at all?

Dr B
no,its not workin
but i got the solution
it was just the matter of qoutes

<%


bc=request.form("txtbc")
response.Cookies("bn")=bc

set con=server.CreateObject("ADODB.connection")
con.open "File Name=C:\Inetpub\wwwroot\library\mylink.udl"


set rsa=server.CreateObject("ADODB.recordset")
rsa.open "select * from Book where Bnum="&bc&" ",con

'before it was ' " &bc& " '

if rsa.eof then response.Redirect("12updbook3.asp")


%>
Mar 4 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.