I have an asp page calling a SQL Server stored Procedure to update a table. The field in the stored procedure is a datetime field.
The asp page code is:
Error converting date type char to int.
Set cmdUpdateZIPCode = Server.CreateObject("ADODB.Command")
cmdUpdateZIPCode.ActiveConnection = connection string
cmdUpdateZipCode.CommandText = "StoredProcedure"
cmdUpdateZIPCode.CommandType = 4
cmdUpdateZipCode.CommandTimeout = 0
cmdUpdateZipCode.Parameters.Append cmdUpdateZipCode.CreateParameter("@date", adDBTime, adParamInput)
cmdUpdateZipCode.Parameters("@date") = CDate(Request.Form("txtDate"))
cmdUpdateZipCode.Execute
<html>
<head>
<title></title>
</head>
<body>
<form>
<!-- DATE EXPIRED -->
<td colspan=2 style='font-size: 12px; font-weight: bold; text-align: right;'>Date Expired</td>
<td colspan=3>
<input name='txtDate' value='<%= rsZIPCodes("ZIPDateExpired")%>'></td>
</form>
</body>
</html>
For all the other fields on the page, this works fine. However, if an entry is made into this date field I get the following error:
"Error converting date type char to int."
How can I get this thing to take a date?
The asp page code is:
Error converting date type char to int.
Set cmdUpdateZIPCode = Server.CreateObject("ADODB.Command")
cmdUpdateZIPCode.ActiveConnection = connection string
cmdUpdateZipCode.CommandText = "StoredProcedure"
cmdUpdateZIPCode.CommandType = 4
cmdUpdateZipCode.CommandTimeout = 0
cmdUpdateZipCode.Parameters.Append cmdUpdateZipCode.CreateParameter("@date", adDBTime, adParamInput)
cmdUpdateZipCode.Parameters("@date") = CDate(Request.Form("txtDate"))
cmdUpdateZipCode.Execute
<html>
<head>
<title></title>
</head>
<body>
<form>
<!-- DATE EXPIRED -->
<td colspan=2 style='font-size: 12px; font-weight: bold; text-align: right;'>Date Expired</td>
<td colspan=3>
<input name='txtDate' value='<%= rsZIPCodes("ZIPDateExpired")%>'></td>
</form>
</body>
</html>
For all the other fields on the page, this works fine. However, if an entry is made into this date field I get the following error:
"Error converting date type char to int."
How can I get this thing to take a date?