Copy link to clipboard
Copied
I just tried Dreamweaver CS3. Looks like that it creates different recordset than in previous version.
When I create recordset and use % as default value to showw all records if parameter is missing I am getting error.
How to show all records if parameter is missing???
<%
Dim rute__MMColParam
rute__MMColParam = "%"
If (Request.QueryString("barki") <> "") Then
rute__MMColParam = Request.QueryString("barki")
End If
%>
<%
Dim rute
Dim rute_cmd
Dim rute_numRows
Set rute_cmd = Server.CreateObject ("ADODB.Command")
rute_cmd.ActiveConnection = MM_conn_STRING
rute_cmd.CommandText = "SELECT * FROM dbo.calendar_Itin WHERE Bbrdd = ?"
rute_cmd.Prepared = true
rute_cmd.Parameters.Append rute_cmd.CreateParameter("param1", 5, 1, -1, rute__MMColParam) ' adDouble
Set rute = rute_cmd.Execute
rute_numRows = 0
%>
and I got this
ADODB.Command error '800a0d5d'
Application uses a value of the wrong type for the current operation.
/adm/itineraries.asp, line 59
Copy link to clipboard
Copied
Thread moved to the appropriate forum: Dreamweaver Application Development.
Copy link to clipboard
Copied
Wildcards can only be used with the 'Like' predicate, not with '='. To have the query return all results if the parameter is missing, put your If condition around the rute_cmd.CommandText. If the parameter is not null, use it in the where clause, otherwise don't include the where clause at all. More complex where clauses that may include multiple parameters can also be built in a similar fashion.