Accessing Excel Using ADO
| From: | Herhuth, Ron | Date: | Fri, 20 Jun 2003 12:26:04 +0000 |
| Subject: | Accessing Excel Using ADO | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-20441@lists.php.net to get a copy of this message | ||
I'm trying to access an Excel document as a database using ADO. I've
found several snippets of code on the subject but I'm not having any luck
getting it going. So far I am using just this fragment of code to connect
but I'm getting an error that I don't know how to correct:
Code:
<?
$conn = new COM("ADODB.Connection");
$dsn = "DRIVER={Microsoft.Jet.OLEDB.4.0}; DBQ=" .
realpath("D:\public\testing\touchContactsWithTatumEmails.xls");
$conn->Open($dsn);
?>
Error:
Warning: Invoke() failed: Exception occurred. Source: Microsoft OLE DB
Provider for ODBC Drivers Description: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver specified in
D:\public\testing\excelCOM.php on line 10
I'm not sure what I am doing wrong or how to correct it.
If you have any information on this subject or have any ideas, I would be
grateful for your input.
-- Ron Herhuth
-- Senior Developer
-- ron.herhuth@tatumpartners.com