Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Wildcart search - where to put the %%

New Here ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

291
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

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



Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines