Conn.Open DSN strSQL = "Select * from produkter where id = '" & Request.QueryString("id") & "'" Set rs = Conn.Execute(strSQL) ´Der fejlen er´ (line 20) Do While Not rs.EOF %> %> <form action="add.asp" method="post"> <input type="text" value="<%Respons.Wirte rs("Navn")%> " name="produkt1"> <input type="text"name="produkt2"> <select size="1" name="produkt3"> <option value="ja">ja</option> <option value="nej">nej</option> </select> <input type="text" name="produkt4"> </select> <input type="text" name="produkt5"> </select> <input type="submit" value="Ok"> <% Loop
Conn.Close Set Conn = Nothing %>
Fejltype: Microsoft OLE DB Provider for ODBC Drivers (0x80040E07) [Microsoft][ODBC Microsoft Access-driver] Datatyperne stemmer ikke overens i kriterieudtrykket.
Prøv at sætte en response.write ind: strSQL = "Select * from produkter where id = " & Request.QueryString("id") response.write strSQL 'Set rs = Conn.Execute(strSQL)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <% If Session("login") <> "JA" Then Response.Redirect "login.asp" End If %> <head> <title>Nyt dokument</title> <meta name="generator" content="TSW WebCoder"> </head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <% If Session("login") <> "JA" Then Response.Redirect "login.asp" End If %> <head> <title>Nyt dokument</title> <meta name="generator" content="TSW WebCoder"> </head>
<body> <%Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("shop.mdb") strSQL = "Select * from produkter where id = " & CInt(Request.QueryString("id")) response.write strSQL Set rs = Conn.Execute(strSQL) if rs.eof or rs.bof then else Do While Not rs.EOF %> <form action="" method="post"> <input type="text" value="<% Response.Write rs("Navn") %> " name="produkt1"> <input type="text" name="produkt2"> <select size="1" name="produkt3"> <option value="ja">ja</option> <option value="nej">nej</option> </select><input type="text" name="produkt4"> <input type="text" name="produkt5"> <input type="submit" value="Ok"> </form> <% Loop rs.movenext end if Conn.Close Set Conn = Nothing %> </body> </html>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.