Displays a list of all available photo galleries
| Photo gallery list: |
<%
Dim strConnection ' database connection string
Dim conn ' database connection
Dim rsGallery ' photogallery recordset
Dim sql ' sql query
'Variables mapping the database fields
Dim intGallery_ID
Dim strGallery_Name
Dim strGallery_Description
Dim i
'Connect to the database
'strConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.MapPath("photogallery.mdb") & ";"
'strConnection ="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("photogallery.mdb") & ";"
'Set conn = Server.CreateObject("ADODB.Connection")
'conn.Open(strConnection)
'MySQL Connection
strConnection = "Driver={MySQL ODBC 3.51 Driver}; Server=sql3de.your-server.co.za; Database=voiceofthecape; UID=vocfma_1; PWD=MJHEufA5; Option=3"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open(strConnection)
sql = "SELECT * FROM gallery WHERE Active = 1;"
Set rsGallery = conn.Execute(sql)
rsGallery.MoveFirst
i = 1
While Not rsGallery.EOF
Response.Write ""
Response.Write " | " & i & ". " & rsGallery("Name") & " - " & rsGallery("Description") & " | "
Response.Write "
"
rsGallery.MoveNext
i = i + 1
Wend
rsGallery.Close
Set rsGallery = Nothing
%>