Wrox Programmer Forums
|
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
 
Old January 6th, 2005, 09:38 PM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Request.QueryString

trying to pull data from ms access with no success.
[u]error message:</u>
Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/calendars/ccl/list_form.asp, line 22

[u]code</u>
Option Explicit
Response.Expires = 0

Dim objConn, objRs, Sql
Dim strConnection, courtdate

courtdate = Request.QueryString("cdate")

Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("diary.mdb")
objConn.Open strConnection

Set objRs = Server.CreateObject("ADODB.Recordset")
Set objRs.ActiveConnection = objConn

Sql = "SELECT id, crtdate, crttime, cnumber, text_field, etype "
Sql = Sql & "FROM diary "
Sql = Sql & "WHERE crtdate= '" & courtdate & "' "
objRs.Open Sql, objConn

Will keep trying to figure, any help would be grealty appreciated.

Mike

Mike
__________________
Mike
 
Old January 6th, 2005, 10:32 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

 try this


Sql = "SELECT id, crtdate, crttime, cnumber, text_field, etype "
Sql = Sql & "FROM diary "
Sql = Sql & "WHERE crtdate=#" & courtdate & "#"



In Access, date is surrounded by # not '


----------
Rajani

 
Old January 7th, 2005, 12:20 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I assume that "crtdate" in MS Access is a date field.

 If so, your problem will be solved by using the code below.
Code:
 Sql = Sql & "WHERE crtdate= #" & courtdate & "# "
 
Old January 7th, 2005, 04:19 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

try by converting that into date type like..

If courtdate <> "" Then
   courtdate = cDate(courtdate)
End If


Thanks
Suresh


 
Old January 7th, 2005, 02:04 PM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks guys for the info. But about two hours after posting topic I figured out what needed to be done and it was exactly what you guys mentioned.

Again thanks for help.

Mike





Similar Threads
Thread Thread Starter Forum Replies Last Post
Request.Form / Request.QueryString Toran Classic ASP Databases 4 January 17th, 2007 02:23 PM
Chapter 7, Request.QueryString problem pacoruizuk BOOK: Beginning ASP 3.0 1 May 19th, 2006 12:32 PM
Request.Querystring ms_code_bsuter ASP.NET 1.0 and 1.1 Basics 1 February 10th, 2006 08:10 PM
request querystring dannyphw ASP.NET 1.0 and 1.1 Basics 1 October 25th, 2004 10:35 AM
request.querystring() , request.form() alyeng2000 ASP.NET 1.0 and 1.1 Basics 1 December 30th, 2003 12:07 AM





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