|
|
<%=strGalleryName%>:
|
<%
Dim strConnection ' database connection string
Dim conn ' database connection
Dim rsPhoto ' photo recordset
Dim sql ' sql query
'Variables mapping the database fields
Dim intPhoto_ID
Dim intGallery_ID ' lists the existing galleries
Dim strPhoto_Caption
Dim strPhoto_URL
intGallery_ID = Int(Request.QueryString("galID"))
'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 photo WHERE Gallery_ID = " & intGallery_ID & " ORDER BY ID DESC;"
Set rsPhoto = conn.Execute(sql)
rsPhoto.MoveFirst
'Display the images thumbnail size with their captions?
While Not rsPhoto.EOF
Response.Write ""
Response.Write "  & ") " & rsPhoto("Caption") & "
| "
'Response.Write "  & ") " & rsPhoto("Caption") & "
| "
Response.Write " "
rsPhoto.MoveNext
Wend
rsPhoto.Close
Set rsPhoto = Nothing
%>
Back to photo gallery list
|
|
|
|