Plastic Box
14-08-2007, 10:03 PM
OK Dreamweaver isn't that helpful when it comes to complex SQL statements.
The following doesn't produce any errors, but it doesn't provide the output I'm expecting!
I'm confident that MMColParam and MMColParam2 are correct - it's the date thing I'm having problem with. Data is stored in a MySQL database and the event_date is stored as a date within the database. I'm trying to pull all events out of the database that happen after today.
If you could point out what is probably a small error I'd be very grateful!
Cheers
<%
Dim thedate
thedate = date()
%>
<%
Dim rs_whatson__MMColParam
rs_whatson__MMColParam = "Local Event"
If (Request("MM_EmptyValue") <> "") Then
rs_whatson__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rs_whatson__MMColParam2
rs_whatson__MMColParam2 = "1"
If (Request("MM_EmptyValue") <> "") Then
rs_whatson__MMColParam2 = Request("MM_EmptyValue")
End If
%>
<%
Dim rs_whatson__MMColParam3
rs_whatson__MMColParam3 = thedate
If (("MM_EmptyValue") <> "") Then
rs_whatson__MMColParam3 = ("MM_EmptyValue")
End If
%>
<%
Dim rs_whatson
Dim rs_whatson_cmd
Dim rs_whatson_numRows
Set rs_whatson_cmd = Server.CreateObject ("ADODB.Command")
rs_whatson_cmd.ActiveConnection = MM_website_data_STRING
rs_whatson_cmd.CommandText = "SELECT * FROM 964_websitedata.whatson WHERE event_type = ? AND event_online = ? AND event_date > ? ORDER BY event_date ASC"
rs_whatson_cmd.Prepared = true
rs_whatson_cmd.Parameters.Append rs_whatson_cmd.CreateParameter("param1", 200, 1, 255, rs_whatson__MMColParam) ' adVarChar
rs_whatson_cmd.Parameters.Append rs_whatson_cmd.CreateParameter("param2", 5, 1, -1, rs_whatson__MMColParam2) ' adDouble
rs_whatson_cmd.Parameters.Append rs_whatson_cmd.CreateParameter("param3", 200, 1, 255, rs_whatson__MMColParam3) ' adVarChar
Set rs_whatson = rs_whatson_cmd.Execute
rs_whatson_numRows = 0
%>
The following doesn't produce any errors, but it doesn't provide the output I'm expecting!
I'm confident that MMColParam and MMColParam2 are correct - it's the date thing I'm having problem with. Data is stored in a MySQL database and the event_date is stored as a date within the database. I'm trying to pull all events out of the database that happen after today.
If you could point out what is probably a small error I'd be very grateful!
Cheers
<%
Dim thedate
thedate = date()
%>
<%
Dim rs_whatson__MMColParam
rs_whatson__MMColParam = "Local Event"
If (Request("MM_EmptyValue") <> "") Then
rs_whatson__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rs_whatson__MMColParam2
rs_whatson__MMColParam2 = "1"
If (Request("MM_EmptyValue") <> "") Then
rs_whatson__MMColParam2 = Request("MM_EmptyValue")
End If
%>
<%
Dim rs_whatson__MMColParam3
rs_whatson__MMColParam3 = thedate
If (("MM_EmptyValue") <> "") Then
rs_whatson__MMColParam3 = ("MM_EmptyValue")
End If
%>
<%
Dim rs_whatson
Dim rs_whatson_cmd
Dim rs_whatson_numRows
Set rs_whatson_cmd = Server.CreateObject ("ADODB.Command")
rs_whatson_cmd.ActiveConnection = MM_website_data_STRING
rs_whatson_cmd.CommandText = "SELECT * FROM 964_websitedata.whatson WHERE event_type = ? AND event_online = ? AND event_date > ? ORDER BY event_date ASC"
rs_whatson_cmd.Prepared = true
rs_whatson_cmd.Parameters.Append rs_whatson_cmd.CreateParameter("param1", 200, 1, 255, rs_whatson__MMColParam) ' adVarChar
rs_whatson_cmd.Parameters.Append rs_whatson_cmd.CreateParameter("param2", 5, 1, -1, rs_whatson__MMColParam2) ' adDouble
rs_whatson_cmd.Parameters.Append rs_whatson_cmd.CreateParameter("param3", 200, 1, 255, rs_whatson__MMColParam3) ' adVarChar
Set rs_whatson = rs_whatson_cmd.Execute
rs_whatson_numRows = 0
%>