我正在将 ASP 经典应用程序移动到新服务器。我没有开发这个应用程序,我没有使用 ASP 的经验,希望有人能指导我。
应用程序中的一个页面会删除此错误:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
/clientname/Admin/EntregasProcess.asp, line 49
我读到可能是日期格式,所以我将其更改为 yyyy-mm-dd。
现在它显示了这一点:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
/clientname/Admin/EntregasProcess.asp, line 62
数据库上的日期格式是这样写的:
2006-07-31 00:00:00.000
这是asp文件的代码:
<%@ Language=VBScript %>
<!--#include file="StrConn.asp"-->
<%
if Session("Role") <> "AD" Then 'AD=Administrador, CG = Consulta Gral.
Response.Redirect "../home.asp"
end if
%>
<%
Dim month_number, year_number, day_number, tituloEntrega, Estatus, idCuestionario, date_number
month_number = Request.Form("month_number")
year_number = Request.Form("year_number")
day_number = Request.Form("day_number")
tituloEntrega = trim(Request.Form("tituloEntrega"))
idCuestionario = Request.Form("idCuestionario")
Estatus = Request.Form("Estatus")
idEntrega = Request.Form("idEntrega")
<!--BITACORA::ESC::Oscar Salgado 20090729-->
bitacora = Request.Form("bitacora")
page = Request.Form("page")
<!--=====================================-->
date_number = dateSerial(year_number,month_number+1,day_number)
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strConnPortal
<!--BITACORA::ESC::Oscar Salgado 20090729-->
SQL="Delete from dbo.tbBitacoraShow where idCuestionario = " & idCuestionario
conn.execute(SQL)
if bitacora = "1" Then
SQL="Insert into dbo.tbBitacoraShow(idCuestionario) values(" & idCuestionario & ")"
end if
conn.execute(SQL)
<!--=====================================-->
Select Case Request.Form("btnGo")
Case "Agregar"
if trim(tituloentrega) <> "" Then
SQL = "Insert into tbEntregas(TituloEntrega,Date,Estatus,IDCuestionario) values('" & _
tituloEntrega & "','" & date_number & _
"'," & estatus & ",'" & idCuestionario & "')"
conn.Execute sql
end if
'Response.Write SQL
'Response.End
Case "Actualizar"
SQL = "update tbEntregas Set TituloEntrega = '" & tituloEntrega & _
"',Date='" & date_number & " ',Estatus=" & estatus & _
",IdCuestionario='" & idCuestionario & "' Where idEntrega = " & idEntrega
conn.Execute sql
'Response.Write SQL
'Response.End
End Select
Response.Redirect "Entregas.asp?idEntrega="&idEntrega&"&page="&page
%>