Hvorfor virker dette ikke ?
HejHvorfor virker dette ikke?
<%
data1 = "test"
feld1 = "pcname"
Set DataConn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = dsn & "DBQ=" & server.mappath("it.mdb")
DataConn.Open DSN
Set mehl = Server.CreateObject("ADODB.RecordSet")
mehl.open "SELECT * FROM hardware where "&request("feld1")&" = '"&request("data1")&"'", DataConn
Set rs = mehl
If rs.BOF Or rs.EOF Then
Response.Redirect("default.asp?iframe=none&action=none")
end if
%>
<%
while not rs.eof
%>
<TABLE>
<TR>
<TD>PC Navn</TD>
<TD>Serial nr.</TD>
<TD>Type</TD>
<TD>Scannet af</TD>
<TD>Tid</TD>
<TD>HP Varenti</TD>
<TD>SMS PC data</TD>
<TD>Slet</TD>
</TR>
<TR>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
<TD><% response.write (mehl("id")) %></TD>
</TR>
</TABLE>
<%
rs.movenext
wend
%>
jeg får denne fejl:
Technical Information (for support personnel)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '= '''.
/amcor-art/default.asp, line 157
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Page:
GET /amcor-art/default.asp
Time:
6. oktober 2004, 17:55:17
More information:
Microsoft Support