Hej Gruppe
Jeg er i gang med at lære ASP. jeg jar købt en ellers udemærket (ASP Active
Server Pages) af Christoph Willw & Christian Koller.
Jeg anvender Access 2000
Jeg er dog løbet ind i et problem med følgende script:
<%@ Language=VBScript %>
<%
Option Explicit
Dim objConn, objRS, strQ, strConnection
Set objConn = Server.CreateObject ("ADODB.Connection")
strConnection = "Data Source=Northwind;Uder Id=sa;Password=;"
objConn.Open strConnection
Set objRS=Server.CreateObject ("ADODB.Recordset")
Set objRS.ActiveConnection = objConn
strQ = "SELECT products.ProductID,Products.ProductName,"
strQ = strQ & "Products.QuantityPerUnit,Products.UnitPrice,"
strQ = strQ & "Caregories.CaregoryName "
strQ = strQ & "FROM Products INNER JOIN "
strQ = strQ & "Categories ON "
strQ = strQ & "Products.CategoryID = Categories.CategoryID "
strQ = strQ & "WHERE (Products.Discontinued = 0) "
strQ = strQ & "ORDER BY Categories.CategoryName"
objRS.Open strQ
%>
<html>
<head><title>Products</title></head>
<body bgcolor=#ffffff>
<table border=1><tr>
<th align="left">Product</th>
<th align="left">Quantity Per Unit</th>
<th align="left">Price</th><th align="left">Categori</th>
</tr>
<%
While Not objRS.EOF
Response.Write "<tr><td><a href=""bag.asp2?id=" & objRS(0) & """>"
Response.Write Server.HTMLEncode (objRS(1)) & "</a></td>"
Response.Write "<td>" & objRS(2) & "</td>"
Response.Write "<td>" & objRS(3) & "</td>"
Response.Write "<td>" & objRS(4) & "</td>"
Response.Write "</tr>" & vbCrLf
objRS.MoveNext
Wend
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</table>
</body>
</html>
Der fremkommer følgende fejlkode:
Microsoft OLE DB Provider for ODBC Drivers fejl '80040e10'
[Microsoft][ODBC Microsoft Access-driver] Der er for få parametre. Der var
ventet 3.
/Project7/ASP Page1.asp, linje 22
Med venlig hilsen
Klaus Egebjerg
klausegebjerg@get2net.dk
|