Yan Cui
September 19th, 2000, 04:08 PM
I wrote an ASP to receive a string from a XML form, and use the string received to search records in a table. It didn't work. I can't find the problem. Here is the code:
code = Request.form("bkcode") 'get the book code from the client
name = Request.form("bktitle") 'get the book title from the client
set rs = Server.CreateObject("ADODB.Recordset")
set cn = Server.CreateObject("ADODB.Connection")
addcomment = "addbkcomment.asp?bkcode=" & code & "&bktitle=" &name
'find all the comments on the book
cn.Open "DSN = YanPrj"
sql = "select * from BkComment where BookCode='"&code&"'"
rs.Open sql, cn
I checked the value of code, it did contain the right value. If I change the where clause to "where BookCode = 'b1000'", it did return all the comments that match the BoodCode b1000. Could someone help me?
code = Request.form("bkcode") 'get the book code from the client
name = Request.form("bktitle") 'get the book title from the client
set rs = Server.CreateObject("ADODB.Recordset")
set cn = Server.CreateObject("ADODB.Connection")
addcomment = "addbkcomment.asp?bkcode=" & code & "&bktitle=" &name
'find all the comments on the book
cn.Open "DSN = YanPrj"
sql = "select * from BkComment where BookCode='"&code&"'"
rs.Open sql, cn
I checked the value of code, it did contain the right value. If I change the where clause to "where BookCode = 'b1000'", it did return all the comments that match the BoodCode b1000. Could someone help me?