Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 23rd, 2004, 02:34 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing value error...plz help

I have a problem with paging. The problem was when i clicked the next page, an error came out.I was trying to pass the same value to the next page but it seems cant work well. I dont have any idea what's wrong with it. Plz help me....

<LI>Error Type:
Microsoft JET Database Engine (0x80040E07)
Syntax error in date in query expression 'StartBookingDate= ## AND LabID= '''.
/v6/CheckAvailability.asp, line 53

<%Option Explicit
Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adUseClient = 3
Const adCmdText = 1
Const adCmdTableDirect = &H0200
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</HEAD>
<TITLE>Rulang Primary School - Facilities Booking Details</TITLE>
<BODY bgcolor="#FDF8E3">
<%
Dim strConn, objConn
Dim pages, objRs, DisplayNum, i, page, ipage, z
Dim objRsPage, strSQL
Dim RowCount
Dim PageCounter
Dim DateID, RoomID, strPeriod
strConn = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("dbBooking.mdb") & ";Persist Security Info=False"


'Get the Current page
page = request.querystring("page")
If page = "" Then
page = 1
else
page = cint(page)
End If
DisplayNum = 0
DateID = Request.QueryString("StartID")
RoomID = Request.QueryString("ID")
Set objConn = Server.CreateObject ("ADODB.Connection")
Set objRs = Server.CreateObject ("ADODB.Recordset")
objConn.Open strConn
objRs.PageSize =1
objRs.CursorLocation = adUseClient

strSQL = "SELECT StartBookingDate, LabID, Name,PeriodFrom, PeriodTo, Class FROM LAB_BOOKING INNER JOIN STAFF_LISTS ON LAB_BOOKING.TeachersID = STAFF_LISTS.TeachersID WHERE StartBookingDate= #" & DateID & "# AND LabID= '" & RoomID & "' ORDER BY PeriodFrom"

objRs.Open strSQL, objConn

if objRs.EOF OR objRs.BOF Then
response.write "<br><br>"
response.write "<p align=center><b>No Records.</b></p>"
response.write "<p align=center><b>To continue, please close this window...</b></p>"
else
ipage = objRs.PageCount
if page = 0 or page > ipage Then
objRs.AbsolutePage = ipage
else
objRs.AbsolutePage = page
end if

Response.Write("<center><H1 style='font-size:24px;'>Facilities Booking Information<br></H1></center>")
Response.Write("<TABLE Align='CENTER' Border=1 CELLSPACING='10' CELLPADDING='1' WIDTH='625'>")
Response.Write("<tr><th>Booking Date(YYYY-MM-DD)</th><th>Lab</th><th>Start</th><th>End</th><th>Name</th><th>Class</th></tr>")
Do While Not objRs.EOF
Response.Write("<tr><td align= 'center' valign='top' width='300' style='font-size:14px;'>" & objRs("StartBookingDate") & "</td><td valign='top' align= 'center' style='font-size:14px;'>" & objRs("LabID") & "</td><td align= 'center' valign='top' width='200' style='font-size:14px;'>" & objRs("PeriodFrom") & "</td><td align= 'center' valign='top' width='200' style='font-size:14px;'>" & objRs("PeriodTo") & "</td><td align= 'center' valign='top' width='200' style='font-size:14px;'>" & objRs("Name") & "</td><td align= 'center' valign='top' width='200' style='font-size:14px;'>" & objRs("Class") & "</tr>")
DisplayNum = DisplayNum + 1
'Response.write(DisplayNum)
objRs.MoveNext
Loop
End If
Response.Write "</TABLE>"
If ipage > 1 Then
response.write "<p align=center>"
pages = "<b>Pages : &nbsp;"
For z = 1 to ipage
If z = page then
pages = pages & page & " "
Else
response.write "hii"
pages = pages & " <a href=?Date="&DateID&"&room="&RoomID&"&page=" & z & ">" & z & "</a>" & " "End If
Next
response.write pages & "&nbsp;&nbsp;"
End If
if ipage > 1 And page > 1 Then
response.write "<a href=?Date="&DateID&"&room="&RoomID&"&page="& page - 1 &">Previous</a>"end if
response.write "&nbsp;&nbsp;"
If ipage > 1 And page < ipage Then
response.write "<a href=?Date="&DateID&"&room="&RoomID&"&page="& page + 1 &">Next Page</a>"end if
response.write "</b></p>"
objRs.Close
objConn.Close
set objRs = nothing
set objConn = nothing
%>


Reply With Quote
  #2 (permalink)  
Old August 23rd, 2004, 07:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Is this the same as the other thread about pagination?
Reply With Quote
  #3 (permalink)  
Old August 23rd, 2004, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, looks like this has been posted all around here.

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #4 (permalink)  
Old August 23rd, 2004, 11:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Yeah, but this one states that there was an error, while the other says about no paging being shown.

Brian
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error help plz... sweetraskels BOOK: ASP.NET Website Programming Problem-Design-Solution 0 March 12th, 2007 07:58 AM
E-mail error plz help its urget Samikaraeen Pro VB.NET 2002/2003 0 March 3rd, 2005 07:39 AM
can some 1 plz help with this error konaseemakurradu Classic ASP Databases 4 November 26th, 2004 07:14 AM
plz help me solve this error moushumi Classic ASP Databases 1 March 31st, 2004 10:23 PM
Build Error - Plz Help - Thanks ank2go ASP.NET 1.0 and 1.1 Basics 1 February 23rd, 2004 10:09 PM



All times are GMT -4. The time now is 05:52 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.