Noget Access og ASP for begyndere
har et problem med at få det til at virke:<body>
<%
Dim amt
amt = Request.Querystring("sager")%>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("admin/nyheder.mdb")
SQL = "SELECT * FROM Sager WHERE id = "& Request.QueryString("id")
set rs = Conn.Execute(SQL)
%>
If rs.eof then
<div align="center">
<table width="802" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="79" background="IMG/BgLeft.jpg"><img src="IMG/Blank.gif" width="79" height="1"></td>
<td width="6" rowspan="3" bgcolor="#FFFFFF"><img src="IMG/Blank.gif" width="8" height="1"></td>
<td width="628"><img src="IMG/MainBgTopTop.jpg" width="628" height="6"></td>
<td width="10"><img src="IMG/Blank.gif" width="9" height="1"></td>
<td width="79" background="IMG/BgRight.jpg"><img src="IMG/Blank.gif" width="79" height="1"></td>
</tr>
<tr>
<td background="IMG/BgLeft.jpg"> </td>
<td background="IMG/MainBgTop.jpg"><table width="628" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" height="68"><div align="center"></div></td>
<td width="222"><div align="left"><img src="IMG/MainTopLogo.jpg" width="161" height="21"></div></td>
<td width="149"><div align="center"><img src="IMG/MenuTopOn01.jpg" width="94" height="21"></div></td>
<td width="94"><div align="center"><a href="profil.htm"><img src="IMG/MenuTopOff02.jpg" width="37" height="21" border="0"></a></div></td>
<td width="146"><div align="center"><a href="kontakt.htm"><img src="IMG/MenuTopOff03.jpg" width="52" height="21" border="0"></a></div></td>
</tr>
<tr>
<td height="19"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="19"> </td>
<td valign="top"><div align="left">
response.write "<table width='222' border='0'><tr><td width='9'><img src='IMG/MenuDot.jpg' width='6' height='6'></td><td width='203' class='menu'>" & rs("Adresse") & "</td></tr></table>" & vbCrLf
</div></td>
<td colspan="3" valign="top"><table width="359" border="0">
<tr>
<td width="353" height="23"><div align="left" class="menu"><img src="IMG/MainBigName01.jpg" width="252" height="12"><br>
<br>
</div></td>
</tr>
<tr>
<td height="97" class="textgrey"><p align="left">STED: <span class="textred">rs("adresse")<br>
</span>STØRRELSE: <span class="textred">rs("størrelse") m²<br>
</span>ÅRGANG:<span class="textred">rs("årgang") <br>
</span>BESKRIVELSE:<span class="textred">rs("beskrivelse") & "vbCrLf" & "<br>")<br>
</span>PLANTEGNING:<strong class="textred"><a href="rs("link")" target="_blank">Åben plantegning</a><br>
</strong></p>
</td>
</tr>
<tr>
<td height="170" class="textgrey"><div align="left"></div></td>
</tr>
</table></td>
</tr>
</table>
</td>
<td rowspan="2" bgcolor="#FFFFFF"> </td>
<td background="IMG/BgRight.jpg"> </td>
</tr>
<tr>
<td background="IMG/BgLeft.jpg"> </td>
<td><img src="IMG/MainBgBottom.jpg" width="628" height="93" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="1,63,48,92" href="http://www.enovision.dk" target="_blank">
</map></td>
<td background="IMG/BgRight.jpg"> </td>
</tr>
</table>
</div>
rs.movenext
loop
end if
RS.Close
Connect.Close
Set RS = Nothing
Set Connect = nothing
%>
</body>