fejl :-(
Jeg har filen addprod.asp der er include en fil (menu.asp) menu.asp virker fint sammen med alle mine andre filer men ikke med addprod.asp :-((Jeg får fejlen:Microsoft VBScript runtime error \'800a01f4\'
Variable is undefined: \'Conn2\'
/data/menu.asp, line 33
addprod.asp
---------------
<%@ Language=VBScript %>
<% Option Explicit %>
<%
\'shopping cart code on this page -
\'generates session variables with order items
\'a.shopKart - (c) Katrien De Graeve - katrien@URLogy.com
%>
<!-- #include file=\"db.inc\" -->
<%
Dim prodid, quantity, arrCart, scartItem
prodid = Request.Form(\"fproductid\")
quantity = Request.Form(\"fquantity\")
arrCart = Session(\"MyCart\")
scartItem = Session(\"cartItem\")
If scartItem = \"\" Then
Response.Redirect \"error.asp?msg=\" & Server.URLEncode (\"We noticed you do not accept cookies. Please enable cookies to shop.\")
End If
If prodid <> \"\" Then
If scartItem < maxCartItems Then
scartItem = scartItem + 1
End If
Session(\"cartItem\") = scartItem
dim rsItem
Set rsItem = Server.CreateObject(\"ADODB.Recordset\")
rsItem.Open \"products\", dbc, adOpenForwardOnly,adLockReadOnly,adCmdTable
rsItem.Filter = \"catalogID = \" & prodid
If Not rsItem.EOF Then
arrCart(cProductid,scartItem) = rsItem(\"catalogID\")
arrCart(cProductCode,scartItem) = rsItem(\"ccode\")
arrCart(cProductname,scartItem) = rsItem(\"cname\")
arrCart(cQuantity,scartItem) = CInt(quantity)
arrCart(cUnitPrice,scartItem) = rsItem(\"cprice\")
Session(\"MyCart\") = arrCart
rsItem.Close
dbc.Close
End If
Else
Dim strAction
strAction = UCase(Left(Request.Form(\"action\"),3))
Select Case strAction
Case \"FOR\"
Response.Redirect \"default.asp\"
Case \"OPD\"
For i = 1 To scartItem
Dim tquantity
tquantity = Request.Form(\"Quantity\" & Cstr(i))
arrCart(cQuantity,i) = CInt(tquantity)
Next
For i = 1 to scartItem
Dim confirm
confirm = Request.Form(\"selected\" & CStr(i))
If confirm <> \"yes\" Then
scartItem = scartItem - 1
Dim x
For x = 1 to UBound(arrCart,1)
arrCart(x,i) = \"\"
Next
Dim n
n = i
while n < UBound(arrCart,2)
For x = 1 to UBound(arrCart,1)
arrCart(x,n) = arrCart(x,n + 1)
arrCart(x,n + 1) = \"\"
Next
n = n + 1
wend
end If
Next
Session(\"cartItem\") = scartItem
Session(\"MyCart\") = arrCart
Case \"TIL\"
Response.Redirect \"customer.asp\"
End Select
End If
%>
<html>
<head>
<script language=\"JavaScript\" src=\"net_time.js\"></script>
<script language=\"JavaScript\" src=\"frames.js\"></script>
<title>V e l s D a t a . d k</title>
</head>
<body bgcolor=\"#B5BEAD\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" onLoad=\"InternetTime();\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" alink=\"#D2D2D2\">
<div align=\"center\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"700\" height=\"1\">
<caption> </caption>
<tr>
<td width=\"5\" bgcolor=\"#004676\" height=\"19\" valign=\"top\">
<p align=\"left\"><img border=\"0\" src=\"vt.jpg\"></p>
</td>
<center>
<td width=\"119\" bgcolor=\"#004676\" height=\"19\" valign=\"middle\"><b><font color=\"#FFFFFF\" face=\"Verdana\" size=\"1\">VelsData.dk</font></b></td>
<td width=\"422\" bgcolor=\"#004676\" height=\"19\" valign=\"middle\"><font color=\"#000000\"> </font></td>
</center>
<td width=\"203\" bgcolor=\"#004676\" height=\"19\" valign=\"middle\">
<p align=\"right\"><b><font size=\"1\" color=\"#FFFFFF\" face=\"Verdana\"><%=date%> <font face=\"Verdana\" size=\"1\" color=\"#FFFFFF\"><span id=\"reloj\"></span></font>
</font></b></p>
</td>
<td width=\"6\" bgcolor=\"#004676\" height=\"19\" valign=\"top\">
<p align=\"right\"><img border=\"0\" src=\"ht.jpg\"></p>
</td>
</tr>
<center>
<tr>
<td width=\"126\" bgcolor=\"#FFFFFF\" height=\"69\" colspan=\"2\" valign=\"middle\">
<p align=\"center\"> <img border=\"0\" src=\"http://www.vels.dk/beta/1.jpg\"></center>
</td>
<th width=\"360\" bgcolor=\"#FFFFFF\" height=\"1\" bordercolor=\"#000000\" valign=\"top\">
<p align=\"center\"><font face=\"Verdana\" size=\"4\"><br>
</font><font face=\"Verdana\" size=\"4\"><br>
</font></p>
</th>
<center>
</center>
<th width=\"204\" bgcolor=\"#FFFFFF\" height=\"1\" bordercolor=\"#000000\" valign=\"top\" colspan=\"2\" align=\"left\">
</th>
</tr>
<tr>
<td width=\"135\" bgcolor=\"#FFFFFF\" height=\"125\" colspan=\"2\" valign=\"top\">
<p align=\"center\">
<!--#include file=\"menu.asp\" -->
</p>
</td>
<td width=\"565\" bgcolor=\"#FFFFFF\" height=\"125\" valign=\"top\" colspan=\"3\">
<table border=\"0\" width=\"95%\" cellpadding=\"4\">
<tr>
<td width=\"100%\" valign=\"top\">
<h4 align=\"center\"><b><font face=\"Verdana\" size=\"2\" color=\"#000000\">Vare
i kurven:</font></b></h4>
</td>
</tr>
<tr>
<td width=\"620\" valign=\"top\">
<p>
<form action=\"addprod.asp\" method=\"POST\">
<div align=\"center\">
<center>
<table border=\"0\" cellPadding=\"3\" cellSpacing=\"2\" width=\"523\">
<tr bgColor=\"darkblue\">
<td width=\"97\" bgcolor=\"#004676\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"><b>Varenummer</b></font></td>
<td width=\"149\" bgcolor=\"#004676\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"><b>Vare</b></font></td>
<td width=\"52\" bgcolor=\"#004676\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"><b>Antal</b></font></td>
<td width=\"91\" bgcolor=\"#004676\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"><b>Pris
pr. Stk.</b></font></td>
<td width=\"84\" bgcolor=\"#004676\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"><b>Total</b></font></td>
</tr>
<%
Dim isubtotal, i
isubtotal = 0
For i = 1 to scartItem
%>
<tr bgColor=\"navajowhite\">
<td bgcolor=\"#EEEEEE\" width=\"97\"><font face=\"Verdana\" size=\"2\"><input name=\"selected<%= Cstr(i)%>\" type=\"checkbox\" value=\"yes\" checked><%= arrCart(cProductCode,i) %>
</font></td>
<td bgcolor=\"#EEEEEE\" width=\"149\"><font face=\"Verdana\" size=\"2\"><%= arrCart(cProductname,i) %>
</font></td>
<td bgcolor=\"#EEEEEE\" width=\"52\"><font face=\"Verdana\" size=\"2\"><input type=\"text\" name=\"quantity<%= CStr(i) %>\" value=\"<%= arrCart(cQuantity,i) %>\" size=\"6\"></font></td>
<td bgcolor=\"#EEEEEE\" width=\"91\"><font face=\"Verdana\" size=\"2\"><%= FormatCurrency(arrCart(cUnitPrice,i),2) %>
</font></td>
<td bgcolor=\"#EEEEEE\" width=\"84\"><font face=\"Verdana\" size=\"2\">
<p align=\"right\"><%= FormatCurrency(arrCart(cUnitPrice,i) * arrCart(cQuantity,i),2) %>
</font></td>
</tr>
<%
isubtotal = (isubtotal + (arrCart(cUnitPrice,i) * arrCart(cQuantity,i)))
Next
%>
<tr>
<td width=\"97\"></td>
<td width=\"149\"></td>
<td width=\"52\"></td>
<td bgColor=\"#004676\" width=\"91\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"><b>Total</b></font></td>
<td bgColor=\"#EEEEEE\" width=\"84\">
<p align=\"right\"><font face=\"Verdana\" size=\"2\"><%= FormatCurrency(isubtotal,2) %>
</font></td>
</tr>
</table>
</center>
</div>
<p align=\"center\"><br>
<input name=\"action\" type=\"submit\" value=\"Forsæt handel\" style=\"font-family: Verdana; font-size: 10 pt; color: #FFFFFF; background-color: #004676; border-style: outset\">
<input name=\"action\" type=\"submit\" value=\"Opdater\" style=\"font-family: Verdana; font-size: 10 pt; color: #FFFFFF; background-color: #004676; border-style: outset\">
<input name=\"action\" type=\"submit\" value=\"Til kassen\" style=\"font-family: Verdana; font-size: 10 pt; color: #FFFFFF; background-color: #004676; border-style: outset\"></p>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width=\"691\" bgcolor=\"#FFFFFF\" height=\"42\" colspan=\"5\" valign=\"top\">
<p align=\"center\">
<font face=\"Verdana\" size=\"1\">Alle priser er inkl. 25% moms, eksl. leverings omkostninger.<br>
Der tages forbehold for tastefejl, prisændringer og udsolgte varer.<br>
© 2000 <a href=\"mailto:Data@vels.dk\"><font color=\"#000000\">VelsData.dk</font></a></font>
</p>
</td>
</tr>
<tr>
<td width=\"1\" bgcolor=\"#004676\" height=\"19\" valign=\"bottom\">
<p align=\"left\"><font color=\"#FFFFFF\"> <img border=\"0\" src=\"vb.jpg\"></font></p>
</td>
<center>
<td width=\"121\" bgcolor=\"#004676\" height=\"19\"> </td>
<td width=\"420\" bgcolor=\"#004676\" height=\"19\">
<p align=\"center\"><font size=\"1\" face=\"Verdana\" color=\"#FFFFFF\">© 1998-2000
<a href=\"mailto:data@vels.dk\">VelsData.dk</a>
Alle rettigheder forbeholdes.</font></td>
</center>
<td width=\"205\" bgcolor=\"#004676\" height=\"19\">
<p align=\"right\"><font color=\"#FFFFFF\"> </font></td>
<td width=\"1\" bgcolor=\"#004676\" height=\"19\" valign=\"bottom\">
<p align=\"right\"><font color=\"#FFFFFF\"><img border=\"0\" src=\"hb.jpg\"></font></p>
</td>
</tr>
</table>
</div>
<p align=\"center\"> </p>
<p align=\"center\"> </p>
</body>
</html>
menu.asp
----------
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">
<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 4.0\">
<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">
<title>Ny side 1</title>
</head>
<body>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"1\">
<tr>
<td width=\"100%\" bgcolor=\"#004676\">
<p align=\"center\"><b><font face=\"Verdana\" size=\"1\" color=\"#FFFFFF\">->
Menu <-</font></b></p>
</td>
</tr>
<tr>
<center>
<td width=\"100%\" bgcolor=\"#e4e9e9\" valign=\"middle\">
</center>
<%
Set Conn2 = Server.CreateObject(\"ADODB.Connection\")
Conn2.Open \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Request.ServerVariables(\"APPL_PHYSICAL_PATH\") & \"\\data\\admin\\scart.mdb\"
SQLstmt2 = \"SELECT * FROM categories ORDER BY catdescription;\"
\'
\'response.write SQLstmt2
Conn2.Execute (SQLstmt2)
Set rs2 = conn2.Execute(SQLstmt2)
Response.Write \"<form name=\'blah\' method=\'post\' action=\'#\'>\"
Response.Write \"<select name=\'dyr\' onChange=\'window.location.href=this.options[this.selectedIndex].value;\'>\"
Response.Write \"<option selected value = \'default.asp\'>Vælg kategori</option>\"
Do While Not rs2.EOF
Response.Write \"<option value=produkt.asp?katid=\" & rs2(\"categoryID\") & \">\" & rs2(\"catdescription\") & \"</option>\"
rs2.MoveNext
Loop
Response.Write \"</select>\"
Response.Write \"</form>\"
rs2.Close
conn2.Close
Set conn2 = nothing
Set SQLstmt2 = nothing
%>
<div align=\"center\">
<center>
<table>
<tr>
<td width=\"75%\"><b><font size=\"2\" face=\"Verdana\"><a href=\"http://www.vels.dk/data/news.asp\"><font color=\"#000000\" onMouseOver=\"MM_displayStatusMsg(\'- Nyheder -\');return document.MM_returnValue\" onMouseOut=\"MM_displayStatusMsg(\'\');return document.MM_returnValue\">Nyheder</font></a></font></b></td>
</tr>
<tr>
<td width=\"75%\"><b onMouseOver=\"MM_displayStatusMsg(\'- Tilbud -\');return document.MM_returnValue\" onMouseOut=\"MM_displayStatusMsg(\'\');return document.MM_returnValue\"><font size=\"2\" face=\"Verdana\"><a href=\"http://www.vels.dk/data/tilbud.asp\"><font color=\"#000000\">Tilbud</font></a></font></b></td>
</tr>
<tr>
<td width=\"75%\"><b onMouseOver=\"MM_displayStatusMsg(\'- Support -\');return document.MM_returnValue\" onMouseOut=\"MM_displayStatusMsg(\'\');return document.MM_returnValue\"><font size=\"2\" face=\"Verdana\"><a href=\"http://www.vels.dk/data/support.asp\"><font color=\"#000000\">Support</font></a></font></b></td>
</tr>
<tr>
<td width=\"75%\"><b onMouseOver=\"MM_displayStatusMsg(\'- Information -\');return document.MM_returnValue\" onMouseOut=\"MM_displayStatusMsg(\'\');return document.MM_returnValue\"><font size=\"2\" face=\"Verdana\"><a href=\"http://www.vels.dk/data/info.asp\"><font color=\"#000000\">Info</font></a></font></b></td>
</tr>
<tr>
<td width=\"75%\"><b onMouseOver=\"MM_displayStatusMsg(\'- Kontakt VelsData -\');return document.MM_returnValue\" onMouseOut=\"MM_displayStatusMsg(\'\');return document.MM_returnValue\"><font size=\"2\" face=\"Verdana\"><a href=\"http://www.vels.dk/data/kotakt.asp\"><font color=\"#000000\">Kontakt</font></a></font></b></td>
</tr>
<tr>
<td width=\"75%\"><b><font size=\"2\" face=\"Verdana\"><a href=\"http://www.vels.dk/data/\"><font color=\"#000000\" onMouseOver=\"MM_displayStatusMsg(\'- Forsiden -\');return document.MM_returnValue\" onMouseOut=\"MM_displayStatusMsg(\'\');return document.MM_returnValue\">Forsiden</font></a></font></b></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<p align=\"center\">
<center>
<a href=\"http://www.vels.dk/data/addprod.asp\">
<img border=\"0\" src=\"http://www.vels.dk/data/images/indkobskurv.jpg\"></a>
<a href=\"http://www.vels.dk/data/customer.asp\"><img border=\"0\" src=\"http://www.vels.dk/data/images/chekout.jpg\"></a>
</center>
</p>
</body>
</html>
