<% ' create table of contents from Access data base ' process sql statement here DR_ID = request.QueryString("DR_ID") SQLstmt = "SELECT Reports.DR_Location, Reports.DR_From, Reports.DR_email, Reports.DR_Report FROM Reports WHERE (((DR_ID)=" + DR_ID + "));" ' set up and open connection to database 'connect to db set conn = server.createobject("adodb.connection") set rs=Server.CreateObject("adodb.Recordset") conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& request.servervariables("APPL_PHYSICAL_PATH") & "\__mdbdb\divereports.mdb" ' conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& request.servervariables("APPL_PHYSICAL_PATH") & "\cdf\__mdbdb\divereports.mdb" Set rs = conn.execute(SQLstmt) If err.number>0 then response.write "VBScript Errors Occured:" & "

" response.write "Error Number=" & err.number & "

" response.write "Error Descr.=" & err.description & "

" response.write "Help Context=" & err.helpcontext & "

" response.write "Help Path=" & err.helppath & "

" response.write "Native Error=" & err.nativeerror & "

" response.write "Source=" & err.source & "

" response.write "SQLState=" & err.sqlstate & "

" end if IF conn.errors.count> 0 then response.write "Database Errors Occured" & "

" response.write SQLstmt & "

" for counter= 0 to conn.errors.count response.write "Error #" & conn.errors(counter).number & "

" response.write "Error desc. -> " & conn.errors(counter).description & "

" next else ' build html links and pass parameter to display page ' loop through the records and display the information ' using a Do While...Loop statement Do while not rs.eof response.write "

" + RS("DR_Location") + "

" response.write "

" + RS("DR_From") + "

" response.write "

" + RS("DR_email") + "

" response.write "

" + RS("DR_Report") + "

" rs.MoveNext loop end if ' close connection conn.Close set conn = nothing set rs = nothing %>
Continue