我正在开发一个允许用户上传 excel 文件的项目,当用户单击提交时,excel 文件中的数据将进入 MSSQL 数据库。目前,上传工作正常,但无法进入 MSSQL 数据库。
我以前使用过相同的脚本,它运行良好(Windows XP)。现在我已经将我的机器更改为 Windows 7,我收到了 COM 错误。我已经尝试了几乎所有可以上网的方法(dcomcnfg 配置),但没有任何帮助。
请帮忙。
以下是错误消息:
<pre>
Application name: Microsoft Excel
Loaded version: 14.0
function import-->open below filename:
C:/xampp/htdocs/www/mysystem/tmp/import_excel_0.32887000 1336015991.xls
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Excel<br/><b>Description:</b> Microsoft Excel cannot access the file 'C://xampp/htdocs/www/mysystem/tmp/import_excel_0.32887000 1336015991.xls'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.' in C:\xampp\htdocs\www\mysystem\import\ImportData.php:52
Stack trace:
#0 C:\xampp\htdocs\www\mysystem\import\ImportData.php(52): variant->Open('C:/xampp/htdocs...')
#1 C:\xampp\htdocs\www\mysystem\import\ImportData.php(19): Import('C:/xampp/htdocs...')
#2 C:\xampp\htdocs\www\mysystem\index.php(698): require('C:\xampp\htdocs...')
#3 {main}
thrown in C:\xampp\htdocs\www\mysystem\import\ImportData.php on line 52