Hello, i am trying to view an sql statement with parameter values attach to it but somehow when i try to display it, Response.Write( ), it is not showing the values but only the variable that is suppose to be switch to the values. Please help me, today is my deadline!! This is my code
Code:
Dim x, ConnStr, str, cn, cmd, rs, strSQL 'collect values word=Request.QueryString("word") end if 'open connection to db Set cn = Server.CreateObject("ADODB.Connection") ConnStr = "..." cn.Open(ConnStr) Set cmd = Server.CreateObject("ADODB.command") Set rs = Server.CreateObject("ADODB.recordset") Set cmd.ActiveConnection = cn 'statement strSQL = "SELECT * FROM *WHERE (write = @word)" 'assign to parameter cmd.CommandText = strSQL 'assign the value to the statement cmd.Parameters.Append cmd.CreateParameter("@word", 200, 1, 20, word) cmd.CommandText = strSQL Response.Write(strSQL) Set CurrentRecordSet = cmd.Execute()
Comment