Having troubles today...
For the code below, I'm getting the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Packaging_Lot_Number = 05AD17'.
/sterilization/update_pick_sln.asp, line 11
An item of note is that the error shows that my value is coming through fine, and as a redundant check I have a Response.Write statement on the page displaying the value in "packnumber". Problem seems to be with placement of quotes or something...
Full Code:
<%
Dim adoCon
Dim rsSterile
Dim strSQL
Dim PNum
Pnum = Request("packnumber")
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("sterilization.mdb")
Set rsSterile = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM SterilizationLog WHERE Packaging_Lot_Number = " & Request.Form("packnumber")
rsSterile.Open strSQL, adoCon
%>
<% Response.Write Request.Form("packnumber") %><br><br>
<%
Do While not rsSterile.EOF
Response.Write ("<br>")
Response.Write ("<a href=""update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & """>")
Response.Write rsSterile("Sterile_Lot_Number")
Response.Write ("</a>")
Response.Write ("<br>")
rsSterile.MoveNext
Loop
rsSterile.Close
Set rsSterile = Nothing
Set adoCon = Nothing
%>
</td></tr></table></body></html>
For the code below, I'm getting the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Packaging_Lot_Number = 05AD17'.
/sterilization/update_pick_sln.asp, line 11
An item of note is that the error shows that my value is coming through fine, and as a redundant check I have a Response.Write statement on the page displaying the value in "packnumber". Problem seems to be with placement of quotes or something...
Full Code:
<%
Dim adoCon
Dim rsSterile
Dim strSQL
Dim PNum
Pnum = Request("packnumber")
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("sterilization.mdb")
Set rsSterile = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM SterilizationLog WHERE Packaging_Lot_Number = " & Request.Form("packnumber")
rsSterile.Open strSQL, adoCon
%>
<% Response.Write Request.Form("packnumber") %><br><br>
<%
Do While not rsSterile.EOF
Response.Write ("<br>")
Response.Write ("<a href=""update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & """>")
Response.Write rsSterile("Sterile_Lot_Number")
Response.Write ("</a>")
Response.Write ("<br>")
rsSterile.MoveNext
Loop
rsSterile.Close
Set rsSterile = Nothing
Set adoCon = Nothing
%>
</td></tr></table></body></html>