ODBC Microsoft Access-driver
Hvad er der galt, hvorfor er der ikke skrive adgang til databasen?? hvad skal der gøres?Jeg bruger Microsoft Internet Explorer 5 og PWS 5.0(win2000)
Får føljende fejl:
Tekniske oplysninger (for supportteknikere)
Fejltype:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access-driver] Handlingen skal bruge en opdaterbar forespørgsel.
/viskurv.asp, line 14
kode for viskurv:
<%
Response.Expires = 0
Titel = \"Indkøbskurv\"
Set Conn = Server.CreateObject(\"ADODB.Connection\")
Conn.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & server.MapPath(\"shop.mdb\")
Mode = LCase(Request.QueryString(\"Mode\"))
ID = CLng(Request.QueryString(\"ID\"))
Antal = CLng(Request.QueryString(\"Antal\"))
If CLng(Session(\"CartID\")) = 0 then
SQLstmt = \"INSERT INTO ShoppingCarts (SessionID, [Date]) VALUES (\" & Session.SessionID & \", \'\" & Now & \"\');\"
Conn.Execute SQLstmt **** fejlen her (linie 14) *****
Set RS = Conn.Execute (\"SELECT * FROM ShoppingCarts ORDER BY ID Desc\")
Session(\"CartID\") = RS(\"ID\")
End If
Select Case Mode
Case \"tilfoej\"
If Not Conn.Execute(\"SELECT ID FROM Articles WHERE ID = \" & ID).EOF Then
If Conn.Execute(\"SELECT ID FROM ShoppingCartItems WHERE CartID = \" & Session(\"CartID\") & \" AND ArticleID = \" & ID).EOF Then
SQLstmt = \"INSERT INTO ShoppingCartItems (CartID, ArticleID, ArticleAmount) VALUES (\"
SQLstmt = SQLstmt & Session(\"CartID\") & \", \"
SQLstmt = SQLstmt & ID & \", \"
SQLstmt = SQLstmt & \"1);\"
Conn.Execute SQLstmt
Else
Conn.Execute \"UPDATE ShoppingCartItems SET ArticleAmount = ArticleAmount + 1 WHERE CartID = \" & Session(\"CartID\") & \" AND ArticleID = \" & ID
End If
End If
Case \"fjernvare\"
Conn.Execute \"DELETE * FROM ShoppingCartItems WHERE ArticleID = \" & ID
Case \"nytantal\"
If Antal < 1 Then
Conn.Execute \"DELETE * FROM ShoppingCartItems WHERE ArticleID = \" & ID
Else
Conn.Execute \"UPDATE ShoppingCartItems SET ArticleAmount = \" & Antal & \" WHERE ArticleID = \" & ID
End If
Response.Redirect \"viskurv.asp\"
Case \"toem\"
Conn.Execute \"DELETE * FROM ShoppingCartItems\"
Response.Redirect \"viskurv.asp\"
Case \"indtastantal\"
SQLstmt = \"SELECT \"
SQLstmt = SQLstmt & \"(SELECT Name FROM Articles WHERE ID = ShoppingCartItems.ArticleID) AS ArticleText, \"
SQLstmt = SQLstmt & \"ArticleAmount \"
SQLstmt = SQLstmt & \"FROM ShoppingCartItems WHERE CartID = \" & Session(\"CartID\") & \" AND ArticleID = \" & ID & \";\"
Set RS = Conn.Execute(SQLstmt)
End Select
SQLstmt = \"SELECT \"
SQLstmt = SQLstmt & \"(ArticleAmount * (SELECT Price FROM Articles WHERE ID = ShoppingCartItems.ArticleID)) AS ArticlePriceTotal, \"
SQLstmt = SQLstmt & \"(SELECT Price FROM Articles WHERE ID = ShoppingCartItems.ArticleID) AS ArticlePrice, \"
SQLstmt = SQLstmt & \"(SELECT Name FROM Articles WHERE ID = ShoppingCartItems.ArticleID) AS ArticleText, \"
SQLstmt = SQLstmt & \"ArticleID, ArticleAmount \"
SQLstmt = SQLstmt & \"FROM ShoppingCartItems WHERE CartID = \" & Session(\"CartID\") & \"; \"
Set RSList = Conn.Execute(SQLstmt)
Select Case Mode
Case \"indtastantal\"
If Not RS.EOF Then
%>
<form action=\"viskurv.asp\" method=\"nytantal\">
<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\">
<tr bgcolor=\"#FFF7DF\">
<td colspan=\"3\"><b><%= RS(\"ArticleText\") %></b><b></b></td>
</tr>
<tr>
<td bgcolor=\"#FFF7DF\" width=\"1%\" nowrap>Nyt antal</td>
<td bgcolor=\"#FFF9EA\" width=\"99%\">
<input type=\"text\" name=\"antal\" class=\"FlatInput\" maxlength=\"3\" value=\"<%= RS(\"ArticleAmount\") %>\" style=\"width=40; text-align=right;\">
</td>
<td bgcolor=\"#FFF9EA\" width=\"1%\">
<input type=\"submit\" name=\"Submit\" value=\"OK\" class=\"FlatButton\">
</td>
</tr>
</table>
<input type=\"hidden\" name=\"id\" value=\"<%= ID %>\">
<input type=\"hidden\" name=\"mode\" value=\"nytantal\">
</form>
<%
End If
Case Else
If Not RSList.EOF Then
%>
<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\">
<tr>
<td bgcolor=\"#FFF7DF\" width=\"1%\"><center><b>Varenr.</b></td>
<td bgcolor=\"#FFF7DF\" width=\"99%\"><b>Tekst</b></td>
<td bgcolor=\"#FFF7DF\" width=\"1%\"><center><b>Antal</b></td>
<td bgcolor=\"#FFF7DF\" width=\"1%\"><center><b>á</b></td>
<td bgcolor=\"#FFF7DF\" width=\"1%\"><center><b>Total</b></td>
<td bgcolor=\"#FFF7DF\" width=\"1%\"></td>
</tr>
<%
Do While Not RSList.EOF
%>
<tr>
<td bgcolor=\"#FFF9EA\"><center><%= RSList(\"ArticleID\") %></td>
<td bgcolor=\"#FFF9EA\"><a href=\"visvare.asp?id=<%= RSList(\"ArticleID\") %>\"><%= RSList(\"ArticleText\") %></a></td>
<td bgcolor=\"#FFF9EA\"><center><a href=\"viskurv.asp?mode=indtastantal&id=<%= RSList(\"ArticleID\") %>\"><%= RSList(\"ArticleAmount\") %></a></td>
<td bgcolor=\"#FFF9EA\"><center><%= RSList(\"ArticlePrice\") %>,-</td>
<td bgcolor=\"#FFF9EA\"><center><%= RSList(\"ArticlePriceTotal\") %>,-</td>
<td bgcolor=\"#FFF9EA\"><font size=\"1\"><a href=\"viskurv.asp?mode=fjernvare&id=<%= RSList(\"ArticleID\") %>\">Slet</a></font></td>
</tr>
<%
PriceTotal = PriceTotal + RSList(\"ArticlePriceTotal\")
RSList.MoveNext
Loop
%>
<tr>
<td colspan=\"4\" bgcolor=\"#FFF7DF\"><b>Ialt</b></td>
<td bgcolor=\"#FFF9EA\"><center><%= PriceTotal %>,-</td>
<td bgcolor=\"#FFF7DF\"> </td>
</tr>
</table>
<%
Else
%>
<center>Indkøbskurven er tom.</center>
<%
End If
End Select
%>
<p align=\"center\">[<a href=\"viskategori.asp?id=<%= CLng(Session(\"LastCategory\"))%>\">Luk indkøbskurv</a>] [<a href=\"viskurv.asp?mode=toem\">Tøm indkøbskurv</a>] [<a href=\"viskurv.asp\">Genindlæs indkøbskurv</a>]</p>