Question
Need help with URL variable in Select statement
Hi,
I want to create a recordset that will return all the rows in a table where
a column (that is passed by URL variable) is equal to 1.
What I have at the moment is a query that will do this where the column
called 'Semiconductors' is equal to 1. What I need to do is change the
statement so that it will query the database where the column called (URL
VARIABLE called 'application' GOES IN HERE) is equal to 1.
<%
Dim Equipment__MMColParam
Equipment__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
Equipment__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Equipment
Dim Equipment_cmd
Dim Equipment_numRows
Set Equipment_cmd = Server.CreateObject ("ADODB.Command")
Equipment_cmd.ActiveConnection = MM_LogiContent_SQL_STRING
Equipment_cmd.CommandText = "SELECT * FROM dbo.Product WHERE Semiconductors
= ?"
Equipment_cmd.Prepared = true
Equipment_cmd.Parameters.Append Equipment_cmd.CreateParameter("param1", 11,
1, -1, Equipment__MMColParam) ' adBoolean
Set Equipment = Equipment_cmd.Execute
Equipment_numRows = 0
%>
I have tried changing it to :
<%
Dim Equipment__MMColParam
Equipment__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
Equipment__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Equipment
Dim Equipment_cmd
Dim Equipment_numRows
Set Equipment_cmd = Server.CreateObject ("ADODB.Command")
Equipment_cmd.ActiveConnection = MM_LogiContent_SQL_STRING
Equipment_cmd.CommandText = "SELECT * FROM dbo.Product WHERE
Request.Querystring("application") = ?"
Equipment_cmd.Prepared = true
Equipment_cmd.Parameters.Append Equipment_cmd.CreateParameter("param1", 11,
1, -1, Equipment__MMColParam) ' adBoolean
Set Equipment = Equipment_cmd.Execute
Equipment_numRows = 0
%>
Can anyone help me with this?
I want to create a recordset that will return all the rows in a table where
a column (that is passed by URL variable) is equal to 1.
What I have at the moment is a query that will do this where the column
called 'Semiconductors' is equal to 1. What I need to do is change the
statement so that it will query the database where the column called (URL
VARIABLE called 'application' GOES IN HERE) is equal to 1.
<%
Dim Equipment__MMColParam
Equipment__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
Equipment__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Equipment
Dim Equipment_cmd
Dim Equipment_numRows
Set Equipment_cmd = Server.CreateObject ("ADODB.Command")
Equipment_cmd.ActiveConnection = MM_LogiContent_SQL_STRING
Equipment_cmd.CommandText = "SELECT * FROM dbo.Product WHERE Semiconductors
= ?"
Equipment_cmd.Prepared = true
Equipment_cmd.Parameters.Append Equipment_cmd.CreateParameter("param1", 11,
1, -1, Equipment__MMColParam) ' adBoolean
Set Equipment = Equipment_cmd.Execute
Equipment_numRows = 0
%>
I have tried changing it to :
<%
Dim Equipment__MMColParam
Equipment__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
Equipment__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Equipment
Dim Equipment_cmd
Dim Equipment_numRows
Set Equipment_cmd = Server.CreateObject ("ADODB.Command")
Equipment_cmd.ActiveConnection = MM_LogiContent_SQL_STRING
Equipment_cmd.CommandText = "SELECT * FROM dbo.Product WHERE
Request.Querystring("application") = ?"
Equipment_cmd.Prepared = true
Equipment_cmd.Parameters.Append Equipment_cmd.CreateParameter("param1", 11,
1, -1, Equipment__MMColParam) ' adBoolean
Set Equipment = Equipment_cmd.Execute
Equipment_numRows = 0
%>
Can anyone help me with this?
