Why isn't my DB returning the timestamp?
Hi,<BR><BR>I have a mySQL DB (yes.. that's right.. a mySQL Database) with a timestamp column, along with others such as username, topic...etc. <BR><BR>I can withdraw everything from the table except for my timestamp. I get this error:<BR><BR><BR>Vbscript Interpretation error 'ASP 0185 : 800200004'<BR><BR>/clients/poivre_asp/forum/openforum.asp,line 380 <BR><BR><BR>this is the code that takes the data... <BR><BR>timeStamp = RSD("stamp")<BR>db_username = RSD("username")<BR>topic = RSD("topic")<BR><BR><BR>I mean I remove the first line and it works fine.. leave it, get that error. I have looked online for a solution and couldn't find anything... there is nothing on MSDN about how to solve this.. they only tell me "Error Codes explained"... with a 4 word description of the code... <BR><BR>The purpose is to disect the timestamp to write the post time... if I placed a "real" value, it works.... <BR><BR>The timestamp is a 14 character long string. ex:<BR>20010516015116 (year, month, day, hour, minutes, seconds)<BR><BR>I look forward to some input... <BR><BR>Vadim C.<BR>
RE: Why isn't my DB returning the timestamp?
Timestamp isn't ordinarly an ODBC-recognized datatype. With ChiliSoft ASP and the "myODBC" connection, it is recognized and converted correctly to a usable string. But I betcha that the MS ODBC driver doesn't convert it right.<BR><BR>You *might* try converting it via a MySQL function? <BR><BR>Yeah, I just tried it with MySQL (admittedly, still with ChiliSoft ASP on Linux, but since I'm converting the timestamp field to a string it should be the same on Win32) and did something like:<BR><BR>SELECT DATE_FORMAT(theTimeStampField,'%b %d, %Y %l:%i %p') AS strTimeStamp, otherfields FROM table <BR><BR>That gave the timestamp field back as a string of the form:<BR><BR>May 23, 2001 9:46 AM<BR><BR>Play with DATE_FORMAT to get the format you want/need. It *will* be a string when returned from the query, so if you need to then treat it as a VBS DateTime value, do CDATE( RS( "strTimeStamp" ) )
Thanks Bill... I will try playing with this...