Results 1 to 6 of 6

Thread: Yet another Syntax Question

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63

    Question

    What would be the proper sytax to combine these two line of code...

    I am kinda lost with all these single and double quotation marks..

    Sniplet #1
    ============================================================
    set rsRAM = conn.Execute("Select * from TVIMAIN WHERE SYSCAT Like '" _
    & Request.QueryString("SystemId") &"' AND ITEMTYPE = 'RAM'")
    ============================================================




    Sniplet #2
    ============================================================
    Like '*' & 'd' & '*'
    ============================================================

    The second sniplet would need to go around the Request.Querystring less the 'd' in the first sniplet

    To maybe explain it a little simpler the 'd' in the second sniplet is what I would like to replace with the request.query string in the first sniplet but have the code read in the same layout as the first sniplet of code

    Kind Regards,
    Hakan

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    like this?

    set rsRAM = conn.Execute("Select * from TVIMAIN WHERE SYSCAT Like '*" & Request.QueryString("SystemId") & "*' AND ITEMTYPE = 'RAM'")

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    Thanks again Tom... I have inserted your code in place of my exsisting code and have come to notice that my dropdown box is coming back with an error. Within the drop down box the error reads:

    ADODB.Field error '80020009' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /tvi/system_config.asp, line 0

    I have checked to code for what I can recognize as typo's but I could not find any... I checked my drop down box code for typo's also could not find any. I checked the DB to make sure that maybe I had not played around with the Column names or something... Everything checked out...

    Any Ideas??

    Kind Regards,
    Hakan

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    The wildcard character fro ADO is % not * so try this statement:

    Code:
    set rsRAM = conn.Execute("Select * from TVIMAIN WHERE SYSCAT Like '%" & Request.QueryString("SystemId") & "%' AND ITEMTYPE = 'RAM'")
    Hope this helps

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    Yes... that worked perfect... Thank you both for your help...

    Kind Regards,
    Hakan

  6. #6
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    My bad, nice catch Negative0

Posting Permissions

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



Click Here to Expand Forum to Full Width