Hi,
I have the following code:
When I run the strSQL directly against the database for a search word of say "ISSUE" I get 2 records.
The asp page give a result of
BMA Incident Section - Search results for : "ISSUE" found -1 Incidents
If I run the strSQL directly against the database for a search word of say "HELP" I get 0 records.
The asp page in this case still give a result of
BMA Incident Section - Search results for : "HELP" found -1 Incidents
Where have I gone wrong?
Mych
I have the following code:
Code:
<%
'############## BMA Incident Search Routine ################
strSQL = "SELECT * FROM B_INCIDENTS WHERE BIncidentRef LIKE'%" & search & "%' OR BEARS LIKE '%" & search & "%' OR BIncident LIKE'%" & search & "%' OR BUpdates LIKE '%" & search & "%' or BResolution LIKE '%" & search & "%' OR BServer LIKE '%" & search & "%' OR BCPU LIKE '%" & search & "%' OR BService LIKE '%" & search & "%';"
'response.write(strSQL)
Set rsSearch = Server.CreateObject("ADODB.Recordset")
rsSearch.Open strSQL, my_Conn
RecCount = rsSearch.RecordCount
If RecCount = 0 Then %>
<center>
<b>BMA Section - Search results for : "<%=search%>" <font color=red size=3>No BMA Incidents found!</font></center>"
<br />
<%
Else
%>
<center><b>BMA Incident Section - Search results for : "<%=search%>" found <%=reccount%><% If reccount = 1 then %> Incident<% else %> Incidents<% end if %></b></center>
<br />
<center><a href="BIncidentSearch.asp?search=<%=search%>&num=<%=show%>">Click Here to View Results</a></center>
<br />
<%
End If
rsSearch.Close
Set rsSearch = Nothing
%>
When I run the strSQL directly against the database for a search word of say "ISSUE" I get 2 records.
The asp page give a result of
BMA Incident Section - Search results for : "ISSUE" found -1 Incidents
If I run the strSQL directly against the database for a search word of say "HELP" I get 0 records.
The asp page in this case still give a result of
BMA Incident Section - Search results for : "HELP" found -1 Incidents
Where have I gone wrong?
Mych