I'm trying to make a photo gallery displaying pictures from links within a database.
I've done what I thought was correct but its throwing an HTTp 500 Internal Server Error.
Could someone please help me with the code
ThanksCode:<HTML> <HEAD> <TITLE>Gallery Test</TITLE> </HEAD> <!--- ASP code inside the body tags ---> <BODY> <!--- start of ASP code ---> <!--- long lines wrapped using a space and an underscore ---> <% 'Database variable store Dim DB 'connecting to the database Set DB = Server.CreateObject ("ADODB.Connection") 'open the database using the full path (DSN-less) DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + _ "http://www.projectpage.somee.com/gallery.mdb") 'create and set a variable for my data Dim RS Set RS = Server.CreateObject ("ADODB.Recordset") 'SQL to select ALL my photos RS.Open "SELECT * FROM Photos", DB 'error check if there are any records If RS.EOF And RS.BOF Then Response.Write "There are 0 records." 'if theres no errors then Else 'go to the first record RS.MoveFirst 'HTML heading before the loop %> <h3 align="center"><b>Pictures</b></h3> <br> <% 'read through every record in turn until 'End Of File' While Not RS.EOF %> <table border="0"> <tr> <td><div align="center"> <a href="<%Respose.Write RS.Fields (("File Location"))%>" target="_blank"> <img src = "<%Response.Write RS.Fields (("Thumb Location"))%>" alt="<%Response.Write RS.Fields (("Alt Text"))%>"> </a> </div></td> </tr> </table> <% 'go to the next record RS.MoveNext 'until the end Wend 'stop when done End If 'end of ASP %> <!--- back to HTML comment ---> </BODY> </HTML>




Reply With Quote