Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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
  #1 (permalink)  
Old March 11th, 2005, 09:55 AM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL query

I wonder why the following code gives me the following problem?
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/showcv.asp, line 14

The code is :

<%
cv_id = request.querystring("ID")

set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("cv.mdb") & ";"
Set rs = Server.CreateObject("ADODB.Recordset")

sqlQuery = "select * FROM cvtable WHERE ID ='" & cv_id & "'"



rs.open sqlQuery, Conn



%>


Thanks

  #2 (permalink)  
Old March 11th, 2005, 09:59 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

What is the datatype of the ID column? If it's an int, you don't need the quotes around it.
Are you sure that cv_id contains a value?

HTH,

Chris

  #3 (permalink)  
Old March 11th, 2005, 11:38 AM
Authorized User
 
Join Date: Jul 2004
Location: HangZhou, ZheJiang, China.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AFei
Default

OR
you try:
response.write cv_id
response.end()

you can see cv_id value,maybe cv_id not get the value
  #4 (permalink)  
Old March 11th, 2005, 01:41 PM
Authorized User
 
Join Date: Dec 2004
Location: Multan, Punjab, Pakistan.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shankhan Send a message via Yahoo to shankhan
Default

yes and after checking all these things don't forget to check another thing that you are providing the correct name "ID" to request.



Similar Threads
Thread Thread Starter Forum Replies Last Post
sql query i need seearam MySQL 7 November 30th, 2008 03:14 AM
sql query ldp101068 SQL Server 2000 7 December 18th, 2007 04:52 PM
Output Query to txt file from SQL Query everest SQL Server 2005 4 November 22nd, 2007 01:49 AM
SQL Query!! dpkbahuguna Beginning VB 6 5 October 12th, 2007 12:39 AM
Help with SQL query sattaluri Access 2 August 11th, 2006 09:26 AM





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