Query with a *
Hi my problem is that I want to make a query were I can use the * functionnality. I create a query with LIKE [parameter] from access Im able to make a query like *a* and it return all the topic with the letter "a" but if I use my query with my asp code it return nothing WHY???.
My code is quite the same as in the Active Server Page 3.0 book
If I write "Q*" it return nothing instead of all the director beginning with a Q as Quentin Tarantino.
Why and how can I solve that
Thank you very much
Johnjohn
See the code...
<%
Dim objRS, objComm, objParam, strDirector
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect ' fill in the command properties
objComm.CommandText = "qryFilmsByDirector"
objComm.CommandType = adCmdStoredProc
' now the parameters (actually, there's only one parameter here)
Set objParam = _
objComm.CreateParameter("Required Director", adVarChar, adParamInput, 50)
objComm.Parameters.Append objParam
'************************************************* ***
strDirector = "Q*" '"Quentin Tarantino"
'************************************************* ***
objComm.Parameters("Required Director") = strDirector
Set objRS = objComm.Execute ' execute the command and generate the recordset
Set objComm = Nothing ' don't need the Command and Parameter objects
Set objParam = Nothing ' ... so we can clean them up
Response.Write "<H2>Films by " & strDirector & ":</H2>"
While Not objRS.EOF ' now loop through the records
Response.Write objRS("Title") & ", directed by " & objRS("Director") & "<BR>"
objRS.MoveNext
Wend
objRS.Close ' now close and clean up
Set objRS = Nothing
%>
If I write "Q*" it return nothing instead of all the director beginning with a Q.
Why and how can I solve that
Thank you very much
Johnjohn
|