SuperComputing
IS-IT--Management
I am writing a page that reads a barcode number, searches a pervasive table and returns color, size, etc. When setup to search a mdb, I was doing fine. Now I am having syntax trouble with the SELECT query. Any assistance would make my head hurt just a little less. Here is what works:
Please be easy on me, I am new at this and have compiled this from tutorials trying to get it to work.
The "upc" comes from a form on my index.htm page:
<form action="results.asp" method="post">
...
<input type="text" name="upc"><input type="submit" value="Enter">
results.asp:
Dim upc, con, rsBarcodeData, strQuery
upc = Request.Form("upc")
Set con = Server.CreateObject("ADODB.Connection")
con.open "DSN=FTInventory"
strQuery = "SELECT * FROM Barcode WHERE Barcode = " & upc
...
<td><%=rsBarcodeData("Barcode") %></td>
If I put in an actual barcode in the query:
strQuery = "SELECT * FROM Barcode WHERE Barcode = '647484502103' "
Everything works fine, I just don't know the syntax to make it use the upc variable passed from my form.
Thanks in advance!
Please be easy on me, I am new at this and have compiled this from tutorials trying to get it to work.
The "upc" comes from a form on my index.htm page:
<form action="results.asp" method="post">
...
<input type="text" name="upc"><input type="submit" value="Enter">
results.asp:
Dim upc, con, rsBarcodeData, strQuery
upc = Request.Form("upc")
Set con = Server.CreateObject("ADODB.Connection")
con.open "DSN=FTInventory"
strQuery = "SELECT * FROM Barcode WHERE Barcode = " & upc
...
<td><%=rsBarcodeData("Barcode") %></td>
If I put in an actual barcode in the query:
strQuery = "SELECT * FROM Barcode WHERE Barcode = '647484502103' "
Everything works fine, I just don't know the syntax to make it use the upc variable passed from my form.
Thanks in advance!