access_asp thread: AS{ Detail record page.
I am experiencing difficulties with building the TicketDetail page.
I have build an ACCESS Database, out of which I am retrieving information
about the tickets. First page is the page that has 9 different ticket
categories, when a category link is clicked that brings all tickets from
that category. Click here to check what I mean:
http://www.navylifepnw.com/navylife/itt/Ticket1.asp That works well. On that
page each (record) ticket is a link to a TicketDetail page (this is how I do
it):
(<A HREF=""TicketDetail.asp?TicketID=" & objTicketRS.Fields("TicketID") &
""">" & _
objTicketRS.Fields("TicketName") & "</A>)
That works as well.
However, I seem to be having very hard time building the ASP Logic for the
DetailTicket.asp page.
The functionality that I need is the following:
- I need to Request.QueryString the TicketID that was clicked on the
previous page for example Ticket1.asp:
- I need to query the database for that particular ticketID details (that
was passed in the QueryString)
- I also need to build control statements for 4 different genders. One
Ticket may have the price for child, youth, adult and senior and so I need
to show all of those on the TicketDetail.asp page, another Ticket may only
be available for child and adult, and so now I only want to show those 2
rows.
Here is how I started approaching it:
<!-- ----------------- TicketDetail.asp page --------------------------- -->
<%@LANGUAGE="VBSCRIPT"%>
<%Option Explicit%>
<!-- #include file="dataconn.asp" -->
<!-- #include file="../includes/adovbs.inc" -->
<HTML>
<HEAD>
<TITLE>Ticket Detail Page.</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<!-- database feed table -->
<%
Dim TicketID
TicketID = Request("TicketID")
If TicketID = "" Then
Response.Write "<P>I am sorry, No such ticket exists in our
database</P>"
Dim rsTicket
Set rsTicket = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Ticket" & _
"WHERE (TicketID=" & TicketID & ") "
rsTicketl.Open, strSQL, objConn, adOpenStatic, adLockReadOnly
Dim MWRSeniorPrice
Dim MWRAdultPrice
Dim MWRChildPrice
Dim MWRYouthPrice
MWRSeniorPrice = rsTicket("MWRSeniorPrice")
MWRAdultPrice = rsTicket("MWRAdultPric")
MWRChildPrice = rsTicket("MWRChildPrice")
MWRYouthPrice = rsTicket("MWRYouthPrice")
Response.Write _
rsTicket("TicketName") & _
"<TABLE BORDER=""2"" CELLSPACING=""2"" CELLPADDING=""1"">" & _
" <TR>" & _
" <TH BGCOLOR=""#FFCC66""></TH>" & _
" <TH BGCOLOR=""#FFCC66"">MWR Price</TH>" & _
" <TH BGCOLOR=""#FFCC66"">Regular Price</TH>" & _
" <TH BGCOLOR=""#FFCC66"">More Resources</TH>" & _
" <TH BGCOLOR=""#FFCC66"">Avialable at:</TH>" & _
" </TR>" & _
If MWRSeniorPrice = "" Then '
<-------VBScript compilation (0x800A03EA)
Reponse.Write _
" <TR>" & _
" <TD BGCOLOR=""#ECECEC"">Senior</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("MWRSeniorPrice") & "</TD>"
& _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("PubSeniorPrice") &
"</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("ResourceLink") & "</TD>" &
_
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("WSRTV") & "</TD>" & _
" </TR>" & _
End If
If MWRAdultPrice = "" Then
Reponse.Write _
" <TR>" & _
" <TD BGCOLOR=""#ECECEC"">Adult</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("MWRAdultPrice") & "</TD>" &
_
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("PublicAdultPrice") &
"</TD>" & _
" <TD BGCOLOR=""#ECECEC""><A HREF="& rsTicket("ResourceLink") &
">rsTicket("ResourceLink") & "</A>& "</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("NorthSoundSales") & "</TD>"
& _
" </TR>" & _
End If
If MWRChildPrice = "" Then
Reponse.Write _
" <TR>" & _
" <TD BGCOLOR=""#ECECEC"">Child</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("MWRChildPrice") & "</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("PublicChildPrice") &
"</TD>" & _
" <TD BGCOLOR=""#ECECEC""><A HREF="& rsTicket("ResourceLink") &
">rsTicket("ResourceLink") & "</A>& "</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("WestSoundSales") & "</TD>" &
_
" </TR>" & _
End If
If MWRYouthPrice = "" Then
Reponse.Write _
" <TR>" & _
" <TD BGCOLOR=""#ECECEC"">Youth</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("MWRYouthPrice") & "</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("PublicYouhPrice") &
"</TD>" & _
" <TD BGCOLOR=""#ECECEC""><A HREF="& rsTicket("ResourceLink") &
">rsTicket("ResourceLink") & "</A>& "</TD>" & _
" <TD BGCOLOR=""#ECECEC"">" & rsTicket ("EastSoundSales") & "</TD>" &
_
" </TR>" & _
rsTicket.Close
rsTicket = Nothing
Response.Write "</TABLE>"
%>
<BR>
<!-- Addresses & Conatcts start here -->
<!-- #include file="itt_contacts.asp" -->
<!-- End of Addresses & Conatcts here -->
<!--#include file="../copyright.inc" -->
</BODY>
</HTML>
I get Microsoft VBScript compilation (0x800A03EA)
Syntax error
/navylife/itt/TicketDetail.asp, line 43
Here is that line of code that causes problem:
If MWRSeniorPrice = "" Then ' <-------VBScript compilation (0x800A03EA)
Your feedback on that problem solving issue will be greatly appreciated.
Thanks in advance,
Claudia
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com