OleDbConnection Connect=new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+p_filename+";Extended Properties=Excel 8.0;");
Connect.Open();
运行到这里就出现错误。
系统是winXP,框架1.1。错误提示是:
System.UnauthorizedAccessException: Access to the path "C:\Inetpub\wwwroot\BusAdmin\EISWEBSITE\excel\a.xls" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at EISWEBSITE.Business.Frm_ReadJL.btnSubmit_ServerClick(Object sender, EventArgs e) at System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) at System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain() --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain() at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Connect.Open();
运行到这里就出现错误。
系统是winXP,框架1.1。错误提示是:
System.UnauthorizedAccessException: Access to the path "C:\Inetpub\wwwroot\BusAdmin\EISWEBSITE\excel\a.xls" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at EISWEBSITE.Business.Frm_ReadJL.btnSubmit_ServerClick(Object sender, EventArgs e) at System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) at System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain() --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain() at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
解决方案 »
- Aspx页中服务器控制如何得到cs中的值
- 请教CheckBoxList的SelectedIndexChanged事件?
- 关于一个activeX控件报错问题!
- 关于COOKIE的奇怪问题
- 用VS2005的发布功能发布现有网站,出现基类包括字段“ArticleList1”,但其类型(ArticleList)与控件(ASP.article_articlelist_ascx)的类型
- 【问两个简单的问题!】
- datagrid 中复选得处理
- System.Data.ADO 找不到怎么回事??
- 寻VSS6c的完整安装版本,在线等待,谢谢
- 大家來討論:多WEB項目資料共享
- 为什么在TextBox中的文本,空相同的空格,却不一样齐呢?该怎样解决?
- 我在页面中加入用户控件后,页面中的一个ImageButton点击就没有任何反应了,去掉用户控件后就好了,该怎么办?
如果是的话,我想不是文件路径的问题,而是访问权限的问题,你检查aspnet用户是否能对文件存放的目录有访问权限。
如果可以打开,我自然会通过错误处理时判断连接的状态来决定是否需要close。现在的问题是不能打开,那位有遇到这种情况的?!
我也碰到了这个问题,开发机上没问题,一部署到服务器上就出问题了,open出错
有谁知道是怎么回事么?