Yan Cui
September 19th, 2000, 03:16 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:
dim code, name 'hold the textbook code and name
dim addcomment 'hold the link to the addbkcomment.asp
dim rs, cn, sql
dim xmldoc, xsldoc
set xmldoc=Server.CreateObject("Microsoft.XMLDOM") 'create an empty XML document
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?
dim code, name 'hold the textbook code and name
dim addcomment 'hold the link to the addbkcomment.asp
dim rs, cn, sql
dim xmldoc, xsldoc
set xmldoc=Server.CreateObject("Microsoft.XMLDOM") 'create an empty XML document
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?