954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

displaying records horizontally

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:



[-----STAGE-----]


[B] [x] [x] [x] [x]

[x] [x] [B] [x] [x]


[x] [B] [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 “[B]” 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

centurion 5
Newbie Poster
3 posts since Oct 2009
Reputation Points: 10
Solved Threads: 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 [---Stage--] 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.

closetosane
Newbie Poster
12 posts since Jan 2009
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You