0

Hi,

I am building a cinema booking system in ASP/VbScript with MS Access.

I would like to display the records from the recordset in form of:


[x] [x] [x] [x]

[x] [x] [x] [x]


[x] [x] [x] [x]

[x] [x] [x] [x] [x]


[x] [x] [x] [x] [x]

[x] [x] [x] [x] [x]

When the query is run, each record is assigned to each “[x]” to the page. But if the record does not exist them I want “” to be shown. (B – Booked)

Currently my page has a query string value taken from the previous page, and then the SQL code is run which generates the performance times. Each URL record has a seated assigned to it hence why I want to records to show up like the example above.

Hope you can help.

Thanks

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by closetosane
0

You will need to run your SQL in a loop:

For i = 0 to 50

i = i +1

If you are using alpha you will need to run a second loop to include your alpha to your (i)

For a = 1 to 26
    'determine the alpha by a if statment or a case statment 
If a = 1 then strAlpha = "a"   
Elseif a = 2 Then strAlpha = "b"
'etc
'Then a loop for the number of seats in the row
For i = 0 to 50
   strTotal = strAlpha  & i
'Run this varable against the database
 SELECT seats FROM DATABASE WHERE SEAT = strTotal
'Check to see if the record set is populated
If Not RS.EOF THEN
    Response.Write "RS("RS.Value")"
Else
    Response.Write "[B]"
End If
i = i + 1
Next
a = a + 1
Next

So if the querystring you are grabbing has the just throw that in before the loops for the record set.

Thats the jist of it, unless there is a certain part you are having problems with.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.