PDA

Click to See Complete Forum and Search --> : Yet another Syntax Question


HakanAzaklioglu
Jun 16th, 2000, 12:08 AM
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

Clunietp
Jun 17th, 2000, 04:12 AM
like this?

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

HakanAzaklioglu
Jun 18th, 2000, 08:38 PM
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

Negative0
Jun 18th, 2000, 10:37 PM
The wildcard character fro ADO is % not * so try this statement:

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

Hope this helps

HakanAzaklioglu
Jun 18th, 2000, 10:42 PM
Yes... that worked perfect... Thank you both for your help...

Kind Regards,
Hakan

Clunietp
Jun 18th, 2000, 11:06 PM
My bad, nice catch Negative0