Hi there, I hope there's someone out there that can help me with this
problem because it seems to be reccuring and it's driving me nuts!
When I try to run an asp page which displays data from my SQL Server 7 DB
I get this error...
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data
type to smalldatetime data type resulted in an out-of-range smalldatetime
value.
/processes/Data.asp, line 27
The problem that this refers to is this bit of code...
Dim DateA
Dim DateB
DateA = FormatDatetime("01/07/2001",2)
DateB = FormatDatetime(Date,2)
IF Request("DateA" <> "" THEN DateA = Request("DateA"
IF Request("DateB" <> "" THEN DateB = Request("DateB"
set Rs = Server.CreateObject("ADODB.Recordset"
Rs.ActiveConnection = MM_theomn_STRING
Rs.Source = "SELECT * FROM theomn.v_survey WHERE DateInitial > '" & DateA
& "' AND DateExtended < '" & DateB & "'"
Rs.CursorType = 0
Rs.CursorLocation = 2
Rs.LockType = 3
Rs.Open()
Rs_numRows = 0
Now I don't understand why I get this error, because I create this code
locally on my machine and test it using PWS and it comes through lovely,
however when I upload it, I get the error, I always seem to get this
problem when I use dates, are there some basic rules that one should
follow when using dates online?
It's always one rule for local and one rule for the net! grrrr.
Any help would be more than just appreciated!!
Cheers,
Al.
problem because it seems to be reccuring and it's driving me nuts!
When I try to run an asp page which displays data from my SQL Server 7 DB
I get this error...
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data
type to smalldatetime data type resulted in an out-of-range smalldatetime
value.
/processes/Data.asp, line 27
The problem that this refers to is this bit of code...
Dim DateA
Dim DateB
DateA = FormatDatetime("01/07/2001",2)
DateB = FormatDatetime(Date,2)
IF Request("DateA" <> "" THEN DateA = Request("DateA"
IF Request("DateB" <> "" THEN DateB = Request("DateB"
set Rs = Server.CreateObject("ADODB.Recordset"
Rs.ActiveConnection = MM_theomn_STRING
Rs.Source = "SELECT * FROM theomn.v_survey WHERE DateInitial > '" & DateA
& "' AND DateExtended < '" & DateB & "'"
Rs.CursorType = 0
Rs.CursorLocation = 2
Rs.LockType = 3
Rs.Open()
Rs_numRows = 0
Now I don't understand why I get this error, because I create this code
locally on my machine and test it using PWS and it comes through lovely,
however when I upload it, I get the error, I always seem to get this
problem when I use dates, are there some basic rules that one should
follow when using dates online?
It's always one rule for local and one rule for the net! grrrr.
Any help would be more than just appreciated!!
Cheers,
Al.