I have a Database which contains a text field called Item_Number. In my database I have two records. The Item_Numbers for the records are "F01" and "F02". I want to open the database and print the data from the database.
If I use the following statement everything works OK and the data from the table is printed:
rs.Open SELECT * FROM myTbl WHERE Item_Number='Fo1'", conn, 2, 3
Response.Write(rs.Fields("Item_Number").value)
Response.Write(rs.Fields("Field2").value)
etc.
However I want to dynamically select which record I need based on the value in a variable. So I created a variable (vrbl) and populated it with the text of the Item_Number I wanted. Then I used the following statement to access my database and pull out the data from the record based on the value in vrbl:
rs.Open SELECT * FORM myTbl WHERE Item_Number=' & vrbl & '", conn, 2, 3
Response.Write(rs.Fields("Item_Number").value)
Response.Write(rs.Fields("Field2").value)
etc.
The code executes without error but no data is printed.
Any help would be appreciated.
If I use the following statement everything works OK and the data from the table is printed:
rs.Open SELECT * FROM myTbl WHERE Item_Number='Fo1'", conn, 2, 3
Response.Write(rs.Fields("Item_Number").value)
Response.Write(rs.Fields("Field2").value)
etc.
However I want to dynamically select which record I need based on the value in a variable. So I created a variable (vrbl) and populated it with the text of the Item_Number I wanted. Then I used the following statement to access my database and pull out the data from the record based on the value in vrbl:
rs.Open SELECT * FORM myTbl WHERE Item_Number=' & vrbl & '", conn, 2, 3
Response.Write(rs.Fields("Item_Number").value)
Response.Write(rs.Fields("Field2").value)
etc.
The code executes without error but no data is printed.
Any help would be appreciated.