#29171 [Com]: Do not fetch TimeStamp variable
| From: | msisolak at yahoo dot com | Date: | Mon, 26 Jul 2004 15:22:26 +0000 |
| Subject: | #29171 [Com]: Do not fetch TimeStamp variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-63566@lists.php.net to get a copy of this message | ||
ID: 29171
Comment by: msisolak at yahoo dot com
Reported By: alain at samoun dot com
Status: Open
Bug Type: COM related
Operating System: windows XP Pro
PHP Version: 5.0.0
New Comment:
This appears to be an issue with how ADOdb interacts with the new
Variant object in PHP5 (not using variant_date_to_timestamp when
pulling in a date value). See follow-up in ADOdb forum:
http://phplens.com/lens/lensforum/msgs.php?id=10253
Previous Comments:
------------------------------------------------------------------------
[2004-07-15 01:35:39] alain at samoun dot com
Description:
------------
Problem getting TimeStamp data from Access database
XP Pro - PHP 5.0.0 ADODB 2.7 Seems to be a casting problem:
Instead of getting for example: 7/7/2004 4:58:10 PM (A Date/Time data
type in Access) we get no data in PHP 5.
PHP4.3 gets it correctly.
Reproduce code:
---------------
<?PHP
$table= "FORM_ID_274274176";
#Initialize the Database
include("adodb.inc.php");
include("adodb-exceptions.inc.php"); #Catch exeptions in PHP5
include("tohtml.inc.php");
$db = &ADONewConnection("ado_access");
#Access database
$access = 'C:\Program files\forms3\forms32k.mdb';
$myDSN='PROVIDER=Microsoft.Jet.OLEDB.4.0;'
. 'DATA SOURCE=' . $access . ';';
//. 'USER ID=;PASSWORD=;';
@$db->pConnect($myDSN, "", "", "");
#Query Access
$query = "SELECT TimeStamp,A,B FROM $table where A ='TOYOTA'";
$result = $db->Execute($query) or die("Error in query: $query. " .
$db->ErrorMsg());
echo rs2html($result);
?>
Expected result:
----------------
TimeStamp A B
7/7/2004 4:58:10 PM TOYOTA NISSAN
7/7/2004 4:59:00 PM TOYOTA
2
Actual result:
--------------
TimeStamp A B
Thu 01, Jan 1970 TOYOTA NISSAN
Thu 01, Jan 1970 TOYOTA
Note the actual value for the TimeStamp variable is 0, I suppose the
"Thu 01, Jan 1970" is a default?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29171&edit=1