Hi all,

I'm using the following bit of code to try to convert some date fields
to the epoch equivelant, but getting the error:

Microsoft VBScript runtime error '800a0006'

Overflow: '[number: 1142289086]'

/test.asp, line 25

After it hits a certain value. Here's the asp I'm using:

<html>
<head>
<title>Result of Database Query</title>
</head>
<body>
<h1>Result of Database Query - ASP/VBScript</h1>
<%
set myconn = server.createobject("adodb.connection")
connection = "helpdesk"
myconn.open (connection)
set result = server.createobject("adodb.recordset")
result.PageSize = 50
sql = "SELECT id,create_date,lastupdate FROM ooz_tickets"
set result = myconn.execute(sql)
if not result.EOF then
response.write("<p>Data:")
response.write("<table
border=2><tr><th>ID<th>create_date<th>lastupdate<th>newcd<th>newlu")
while not result.EOF
response.write("<tr><td>" & result("id"))
response.write("<td>" & result("create_date"))
response.write("<td>" & result("lastupdate"))
oldid = result("id")
newcd = DateDiff("s", "01/01/1970 00:00:00", result("create_date"))
newlu = DateDiff("s", "01/01/1970 00:00:00", result("lastupdate"))
response.write("<td>" & newcd)
response.write("<td>" & newlu)

result.movenext()
wend
response.write("</table>")
else
response.write("<p>No Entry for " & request("place"))
end if
%>
</p>
</body>
</html>


Line 25 is: newcd = DateDiff("s", "01/01/1970 00:00:00",
result("create_date"))

I'm assuming DateDiff() can't handle numbers greater than some specific
value. How can I get around this, or is there a different way to
convert the date values to epoch?

TIA

Re: how to resolve Microsoft VBScript runtime error '800a0006' by Dan

Dan
Tue Mar 14 07:31:04 CST 2006

Never mind, I saw my goof after posting. Some of the source dates are
already in the proper format, so they are too large to begin with. I
modified my script to skip those.