Hi
I have this annoying problem with ASP/SQL flipping month and day in dates...
I've got a stored proc that expects 2 date params and I have an ASP page that executes it here it is:
I know I need to execute SQL command:
SET DATEFORMAT dmy
before call to my stored proc but how do I do it ??
I know I can execute it on Connection object and then execute my SQL directly on connection it works no problem but in this case I need to execute stored proc...
the only option I know will work with my curent ASP code will be to add SET DATEFORMAT dmy to my stored proc but it's not fesable at the moment as I have no control over stored procs...
Is there any way to enforse specific date format through ASP/ADO ???
Thank you in advance
Sergei
I have this annoying problem with ASP/SQL flipping month and day in dates...
I've got a stored proc that expects 2 date params and I have an ASP page that executes it here it is:
Code:
Set Cmd = Server.CreateObject("ADODB.Command")
With Cmd
.ActiveConnection = strConn
.CommandText = "sp_Synchronise" ' name of stored procedure
.CommandType = adCmdStoredProc
.parameters.refresh
.parameters.item("@startDate") = startDate
.parameters.item("@endDate") = endDate
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs = .Execute
'clean up
Set rs = Nothing
Set Cmd = Nothing
End With
I know I need to execute SQL command:
SET DATEFORMAT dmy
before call to my stored proc but how do I do it ??
I know I can execute it on Connection object and then execute my SQL directly on connection it works no problem but in this case I need to execute stored proc...
the only option I know will work with my curent ASP code will be to add SET DATEFORMAT dmy to my stored proc but it's not fesable at the moment as I have no control over stored procs...
Is there any way to enforse specific date format through ASP/ADO ???
Thank you in advance
Sergei