Solved

error '80020009' Exception occurred.

Posted on 2006-06-15
3
569 Views
Last Modified: 2013-12-03
Here is the page in question:
http://www.jdvcapital.com/data/mlstracking2.asp

Here is the code in question:

<%
set con = Server.CreateObject("ADODB.Connection")
DSNtest="DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql10.ixwebhosting.com;UID=jdvcapi_fs1;PWD=venture;DATABASE=jdvcapi_fs1"
con.open DSNtest

set rec1=con.execute ("SELECT * FROM mlstrack where property = '13 Cliffton' ORDER BY ID ASC")
set rec1count=con.execute ("SELECT count(*) as countrec1 FROM mlstrack where property = '13 Cliffton'")
%>


<table border="1" cellspacing="0" bordercolor="#E5E5E5" cellpadding="3" style="border-collapse: collapse" width="600">
    <tr>
      <td align="center"><b><font size="2" face="Arial">View Date</font></b></td>
      <td align="center"><b><font face="Arial" size="2">View Time</font></b></td>
      <td align="center"><font face="Arial" size="2"><b>IP Address</b></font></td>
      <td align="center"><b><font face="Arial" size="2">Referrer</font></b></td>
      <td align="center"><b><font face="Arial" size="2">Browser</font></b></td>
      <td align="center"><b><font size="2" face="Arial">Language</font></b></td>
    </tr>
    <tr>
      <%while not rec1.eof%>
       <td><%=rec1("viewdate")%>&nbsp;</td>
      <td><%=timevalue(rec1("viewtime"))%>&nbsp;

      </td>
      <td><%=rec1("IPAddress")%>&nbsp;</td>
      <td><%=rec1("referer")%>&nbsp;</td>
      <td><%=rec1("useragent")%>&nbsp;</td>
      <td><%=rec1("language")%>&nbsp;</td>
 
    </tr>
    <%rec1.movenext%>
<%wend%>
<%rec1.close%>
</table>


As you can see it runs and then stops and generates thie error:

error '80020009'
Exception occurred.

/data/mlstracking2.asp, line 141

Line 141 is:
<td><%=timevalue(rec1("viewtime"))%>&nbsp;

as it shows above.

The datatype in the database is TIME

What seems to be the problem?

0
Comment
Question by:jeffreytp
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 16974398
ado is unable to manage the TIME data type. hence, you have to convert it inside the query to string data for example

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
for example:
set rec1=con.execute ("SELECT IPAddress, referer, useragent, language, DATE_FORMAT(viewtime, '%Y-%M-%d' ) as viewtime FROM mlstrack where property = '13 Cliffton' ORDER BY ID ASC")
0
 

Author Comment

by:jeffreytp
ID: 16987297
It worked.  Thank you!
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16987663
Glad I could help.
you should hence close the question.
Regards
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now