Hi friends,
I am trying to connect to an Excel file using ADODB / Jet.
I have no idea why.
Here's the relevant code part:
I see the connection string, hence the Connection object itself works. I've already added the "extension=php_com_dotnet.dll" part to php.ini.
On a previous php page, I already connect to an access database using COM, hence I know it works.
The path to the Excel file is correct, too. It is the absolute path to the Excel, i.e.:
resulting in this output:
Data Source=C:\inetpub\wwwroot\[mydirectory]\[myfile].xls;
I've also tried
just in case the backslash cause any problems although I don't know why it should, it doesn't with the access db.
[mydirectory], [myfile] only masked here, they're normal, explicit folder/file names.
I've given IIS_IUSRS and IIS_WPG sufficient rights to the folder.
Any idea what is wrong here?
Using: PHP 5 under Windows 7, IIS7. No WAMPP/XAMPP whatever.
Thanks for any input!
Cheers,
MakeItSo
“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
I am trying to connect to an Excel file using ADODB / Jet.
I have no idea why.
Here's the relevant code part:
Code:
$strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" . $dbPath . ";Excel 8.0;HDR=Yes;";
//...
$conn = new COM("ADODB.Connection") or die("Cannot connect to Excel");
echo $strConnection;
$conn->Open($strConnection)or die("Cannot connect to Excel");
I see the connection string, hence the Connection object itself works. I've already added the "extension=php_com_dotnet.dll" part to php.ini.
On a previous php page, I already connect to an access database using COM, hence I know it works.
The path to the Excel file is correct, too. It is the absolute path to the Excel, i.e.:
Code:
$dbPath = realpath("../../../[mydirectory]/[myfile].xls");
Data Source=C:\inetpub\wwwroot\[mydirectory]\[myfile].xls;
I've also tried
Code:
$dbPath=str_replace("\\","/",$dbPath);
[mydirectory], [myfile] only masked here, they're normal, explicit folder/file names.
I've given IIS_IUSRS and IIS_WPG sufficient rights to the folder.
Any idea what is wrong here?
Using: PHP 5 under Windows 7, IIS7. No WAMPP/XAMPP whatever.
Thanks for any input!
Cheers,
MakeItSo
“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.