1 Reply Latest reply on Jul 23, 2011 12:18 PM by MurraySummers

    How to get a "WHERE something='Request.Cookies( something)'" to work


      Dreamweaver CS4

      Page Type is ASP JavaScript.



      var Recordset1_cmd = Server.CreateObject ("ADODB.Command");

      Recordset1_cmd.ActiveConnection = MM_iesinvest1_STRING;

      Recordset1_cmd.CommandText = "SELECT subscriber_id, clientmoney, stkcomm, optcomm, stkprmin, stkprmax, divyield, clientpe, hilo, spread, minoptpr, minoptvol, minopenint, retcalled, expdate, clientoptmo, contcomm, retsame FROM ClientOTMData WHERE subscriber_id='Request.Cookies(subid)'";


      Recordset1_cmd.Prepared = true;


      var Recordset1 = Recordset1_cmd.Execute();

      var Recordset1_numRows = 0;



      Whatever is put into the “WHERE subscriber_id=” doesn’t work. Have tried:

                  Request.Cookies(subid) with and without ‘ or “

                  $subid with or without ‘ or “

                  $_POST(subid) with or without ‘ or “

                  @@ subid @@ with or without ‘ or “

                  Subid.value with or without ‘ or “

                  And these and many others with or without ( )


      Error Codes are varied depending on choice above:

           Adobe.field error '800a0bcd'

           Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

           Missing ';" which is there

           And many more


      If any real subscriber_id is typed into the code, like ‘johndoe’ it works.

      Have also placed a docutmnt.write script on the page and it shows the cookie.

      Have also placed a field with ‘Request.Cookie on the pageand it shows the cookie.

      So the cookies is available on the page.


      Is there anything that will work in this Recordset command?


      Any help is appreciated.