Forbindelsen til databasen bliver ikke lukket
Kære liste,Jeg har indsat nedenstående kode i en .asp dokument.
Når jeg kalder siden FØRSTE gang virker det helt perfekt, når jeg så vil kalde siden med en anden querystring, kan der ikke åbnes til database og jeg får en fejl der - ifølge google - betyder at forbindelsen til database ikke kan åbnes fordi den ikke er lukket fra sidste query.
Jeg har set mig blind på koden og kan ikke finde ud af hvad der er galt.
Håber i kan hjælpe
<%
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("db/brts_it_dokumentation.mdb")
Conn.Open DSN
SQL = "Select * From tab_netvaerk_hardware Where netvaerk_hardware_type=" & Request.Querystring("type")
Set rs = Conn.Execute(SQL)
Response.Write "<table width='100%'>"
Response.Write "<tr>"
Response.Write "<td colspan='6'><h3>" & rs("netvaerk_hardware_type") & "</h></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td colspan='6'><hr></td>"
Response.Write "</tr>"
Do While Not rs.EOF
Response.Write "<tr>"
Response.Write "<td colspan='2'>" & rs("netvaerk_hardware_navn") & "</td>"
Response.Write "<td width='15%'>" & "IP-adresse:" & "</td>"
Response.Write "<td width='15%'>" & rs("netvaerk_hardware_ip") & "</td>"
Response.Write "<td width='15%'>" & "MAC-adresse:" & "</td>"
Response.Write "<td width='15%'>" & rs("netvaerk_hardware_MAC_LAN") & "</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td width='10%'>" & "Placering:" & "</td>"
Response.Write "<td width='10%'>" & rs("netvaerk_hardware_placering") & "</td>"
Response.Write "<td width='10%'>" & "Model:" & "</td>"
Response.Write "<td width='20%'>" & rs("netvaerk_hardware_fabrikat") & " / " & rs("netvaerk_hardware_model") & "</td>"
Response.Write "<td width='15%'>" & "Serienummer:" & "</td>"
Response.Write "<td width='15%'>" & rs("netvaerk_hardware_serienummer") & "</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td width='10%'>" & "Krydsfelt:" & "</td>"
Response.Write "<td width='10%'>" & rs("netvaerk_hardware_xf") & " / " & rs("netvaerk_hardware_xf_port") & "</td>"
Response.Write "<td width='10%'>" & "MAC-adresse WLAN (bg):" & "</td>"
Response.Write "<td width='20%'>" & rs("netvaerk_hardware_MAC_WLAN_G") & "</td>"
Response.Write "<td width='15%'>" & "MAC-adresse WLAN (a):" & "</td>"
Response.Write "<td width='15%'>" & rs("netvaerk_hardware_MAC_WLAN_A") & "</td>"
Response.Write "</tr>"
rs.MoveNext
Loop
Conn.Close
Set Conn = Nothing
%>