Skip to main content
Participant
June 28, 2006
Question

Wildcart search - where to put the %%

  • June 28, 2006
  • 2 replies
  • 318 views
I can't figure out where to put the two %% in this code?

<%
Dim sog__MMColParam
sog__MMColParam = "none"
If (Session("sog") <> "") Then
sog__MMColParam = Session("sog")
End If
%>
<%
Dim sog
Dim sog_cmd
Dim sog_numRows

Set sog_cmd = Server.CreateObject ("ADODB.Command")
sog_cmd.ActiveConnection = MM_Conn_STRING
sog_cmd.CommandText = "SELECT * FROM Bog WHERE " & "" + Session("valg") + "" & " LIKE ?"
sog_cmd.Prepared = true
sog_cmd.Parameters.Append sog_cmd.CreateParameter("param1", 200, 1, 255, sog__MMColParam) ' adVarChar

Set sog = sog_cmd.Execute
sog_numRows = 0
%>


Could somebody please help me?
Thank you
Frank
This topic has been closed for replies.

2 replies

LindeskovAuthor
Participant
June 28, 2006
Yes I know that but I would like to use DW to generate most of the code and I can not figure out how and where in the code (above) the %% is going.
But Thank you for the answare anyway.
Frank
Inspiring
June 28, 2006
You need to construct the SQL statement like this:

SELECT * FROM Bog WHERE ColumnName LIKE '%SearchValue%'"

I hope that helps.
Cheers,
Rob
http://robgt.com/ [Tutorials and Extensions]
Firebox stuff: http://robgt.com/firebox
Skype stuff: http://robgt.com/skype
Dell stuff: http://robgt.com/dell
SatNav stuff: http://robgt.com/satnav