Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 7th, 2006, 07:05 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data type mismatch in criteria expression.

I am trying to see information about a specific "host" (like hotel), I wanted to send "Host_Id" to a page which contains a form with all data about the host by its id, using this sentence:
Code:
response.write " / <a href='Mupdate_host.asp?Hid='" & rsHost.Fields("Host_Id") & "'>edit</a>"
Mupdate_host.asp code:
Code:
hostid=request.querystring("Hid")

SQLstring="Select * from tHosts where Host_Id='" & hostid & "'"
set rsHost=Server.CreateObject("ADODB.recordset")
rsHost.activeconnection=connection
rsHost.open SQLstring
"Host_Id" is an automatic number.

Now, when loading the page i get this error:
Code:
Microsoft JET Database Engine error '80040e07' 

Data type mismatch in criteria expression. 

/duckiee/ASP/Mupdate_host.asp, line 18
LINE 18: rsHost.open SQLstring

Thanks in advance.

P.S
If its the wrong forum im sorry :o(

 
Old November 22nd, 2006, 01:19 AM
Authorized User
 
Join Date: Nov 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this
...where Host_Id = " & hostid

(take the literals out, that means youre trying to compare a string not a number)

ex
were string = 'string'
where number = number





Similar Threads
Thread Thread Starter Forum Replies Last Post
data type mismatch in criteria expression coreyjustin Classic ASP Basics 1 December 10th, 2007 06:49 PM
Data type mismatch in criteria expression Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 0 May 5th, 2007 05:29 PM
data type mismatch in criteria expression xigler Access 3 March 23rd, 2007 08:54 AM
Data type mismatch in criteria expression. imercha Classic ASP Basics 3 November 23rd, 2006 11:09 AM
Data type mismatch in criteria expression. kalchev ASP.NET 2.0 Professional 5 April 11th, 2006 11:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.