473,464 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

datatype mismatch error

28 New Member
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
2 1539
DrBunchman
979 Recognized Expert Contributor
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
chirag1989
28 New Member
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

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

Similar topics

2
by: Stephen Briley | last post by:
For some reason, my posts are scrubbed as attachments. Lets hope that sending from the yahoo account works. I'm new to Python and I'm trying to do some database work with MS Access, but I can't...
2
by: Steve Briley | last post by:
I'm new to Python and I'm trying to do some database work with MS Access, but I can't seem to get around a "datatype mismatch error".&nbsp; Here's an example table that I'm working with... ...
1
by: Sam Gledhill | last post by:
I hope somebody can help me, I have a problem executing this line of sql: Dim rstur As New Recordset Dim sql As String sql = "SELECT * FROM tblpat WHERE ='" & Me! & "'" Set rstur =...
1
by: Ken | last post by:
I wrote a function to use in queries that takes a date and adds or subtracts a certain length time and then returns the new value. There are times when my function needs to return Null values. ...
2
by: JingleBEV | last post by:
Hi, Iam coding data access application with database object and recordset. Here' s my code '------------------------------------------------------------------ Private Function CreateRecordSet()...
6
by: rn5a | last post by:
I am inserting records in a MS-Access database table. The data type of one of the columns named *OrderDate* in the DB table is Date/Time. This is the SQL query I am using to insert the records in...
0
by: Snoopy33 | last post by:
I have a query that builds a date from a text field with the date imput as yyyymmdd in the query, so i have to piece it together in my expression as follows: exp:...
9
by: rscheinberg | last post by:
I am working in Access 2007 attempting to grab 2 characters from a text field named ProjectNumber. After determining what 2 digits to add in front to make it a year, I need to do that. I have done...
14
by: rscheinberg | last post by:
I am working in Access 2007 attempting to grab 2 characters from a text field named ProjectNumber. After determining what 2 digits to add in front to make it a year, I need to do that. I have done...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.