Can't get query to operate

Results 1 to 2 of 2

Thread: Can't get query to operate

  1. #1
    Synapse Lapse Guest

    Default Can't get query to operate

    Hey -<BR>I&#039;m having an issue with and SQL statement that&#039;s not working correctly. I&#039;m using Access (I know, I know -I&#039;ve read the articles) and am getting an error message. I am trying to search for a userid based on a cookie value. I converted the cookie value to text and have defined the variable as text in Access, have double checked this and am still getting the messge. The value is being stored in Access(with a previous insert) it&#039;s just not finding it. It&#039;s probably a simple thing I&#039;m missing but I&#039;m having a mental block. <BR>The cookie is defined as<BR><BR>&#060;%<BR>DIM struserid,intvehicleno,strslash,strdate,strspace,s trcolon<BR>strspace=" "<BR>strslash="/"<BR>strcolon=":"<BR>strdate=now()<BR>struserid=cs tr(strdate)<BR>intvehicleno=1<BR>struserid=REPLACE (struserid,strspace,1,1,-1,1)<BR>struserid=REPLACE(struserid,strslash,1,1,-1,1)<BR>struserid=REPLACE(struserid,strcolon,1,1,-1,1)<BR>Response.cookies("userid").expires= date()+30<BR>Response.cookies("userid")("key1")=st ruserid<BR>Response.cookies("userid")("key2")=vehi cleno<BR>%&#062;<BR><BR>The retrieval statement is - <BR>&#060;%<BR>11 set acuraverify = Server.CreateObject("ADODB.Recordset")<BR>12 acuraverify.ActiveConnection = MM_connacurageo_STRING<BR>13 acuraverify.Source = "SELECT user_id FROM tbluserinfo WHERE userid = &#039;" & Request.cookies("Userid") & "&#039;"<BR>14 acuraverify.CursorType = 0<BR>15 acuraverify.CursorLocation = 2<BR>16 acuraverify.LockType = 3<BR>17 acuraverify.Open()<BR>18 acuraverify_numRows = 0<BR>%&#062;<BR>This is the error message-<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e10&#039; <BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. <BR>/webpub/TMPeum8il1xd.asp, line 17<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Can't get query to operate

    The best way to troubleshoot SQL statements is to Response.Write the sql statement out to the screen to see how it is being interpreted. Then it makes it a little easier to play with the quotations and such.<BR><BR>gordon<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts