[OleDbException (0x80004005): Unspecified error]

J

Jim McGivney

ASPX page from VS.net-C# on host's computer using oleDataAdaptor to connect
to Microsoft Access database.
The page loads, but when connection to the database is attempted to fill a
datagrid the following error is generated.
Any help would be appreciated.
Thanks,
Jim

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80004005): Unspecified error]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
Win0905.AnteEditIden.Page_Load(Object sender, EventArgs e) +62
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
 
K

Ken Cox [Microsoft MVP]

Hi Jim,

You might want to check whether the ASPNET account (or the current account
if using impersonation) has Change permissions on the directory where the
Access database is located. Access needs to create a locking file and you
can get an error like this if it is unable to do so because of lack of
permissions.

Ken
MVP [ASP.NET]
 
J

Jim McGivney

Ken Cox:
I am using impersonation. This is probably the cause of my problem.
Please help me with what you may think is a trivial question: If I remove
the impersonation tag from the WebConfig file (<identity impersonate="true"
/> ), what tag(s) do I place to allow me authentication and authorization ?
Where do I place my user name and password ? or what ever else is needed.
This is complicated for me as I develop on my home computer and then use a
Host Service to display my webpage. What works on my home computer does not
always work on the Host's machine.
Thanks,
Jim




Ken Cox said:
Hi Jim,

You might want to check whether the ASPNET account (or the current account
if using impersonation) has Change permissions on the directory where the
Access database is located. Access needs to create a locking file and you
can get an error like this if it is unable to do so because of lack of
permissions.

Ken
MVP [ASP.NET]

Jim McGivney said:
ASPX page from VS.net-C# on host's computer using oleDataAdaptor to
connect to Microsoft Access database.
The page loads, but when connection to the database is attempted to fill
a datagrid the following error is generated.
Any help would be appreciated.
Thanks,
Jim

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80004005): Unspecified error]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
Win0905.AnteEditIden.Page_Load(Object sender, EventArgs e) +62
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
 
K

Ken Cox [Microsoft MVP]

Hi Jim,

Run this script on your page to find out the account that is running
ASP.NET:

<%@ Page Language="vb" %>
<HTML>
<body>
<form id="Form1" method="post" runat="server">
<%Response.write(
System.Security.Principal.WindowsIdentity.GetCurrent().Name)%></form>
</body>
</HTML>

Once you have that account, go into Windows Explorer and navigate to the
directory where the Access database is located. Right-click on the folder
name and in the Security tab*, give that user account Change permissions.

Your host may have to handle this chore for you on the Web server.

* If the Security tab is missing, look here:

http://weblogs.asp.net/kencox/archive/2005/01/24/359695.aspx

Let us know how you make out?

Ken
Microsoft MVP [ASP.NET]


Jim McGivney said:
Ken Cox:
I am using impersonation. This is probably the cause of my problem.
Please help me with what you may think is a trivial question: If I remove
the impersonation tag from the WebConfig file (<identity
impersonate="true" /> ), what tag(s) do I place to allow me authentication
and authorization ? Where do I place my user name and password ? or what
ever else is needed. This is complicated for me as I develop on my home
computer and then use a Host Service to display my webpage. What works on
my home computer does not always work on the Host's machine.
Thanks,
Jim




Ken Cox said:
Hi Jim,

You might want to check whether the ASPNET account (or the current
account if using impersonation) has Change permissions on the directory
where the Access database is located. Access needs to create a locking
file and you can get an error like this if it is unable to do so because
of lack of permissions.

Ken
MVP [ASP.NET]

Jim McGivney said:
ASPX page from VS.net-C# on host's computer using oleDataAdaptor to
connect to Microsoft Access database.
The page loads, but when connection to the database is attempted to fill
a datagrid the following error is generated.
Any help would be appreciated.
Thanks,
Jim

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80004005): Unspecified error]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
Win0905.AnteEditIden.Page_Load(Object sender, EventArgs e) +62
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
 
L

lucy

Hi, Ken
I run into similiar situation like Jim.I can't connect to Access
database from asp.net applicaiton using OLEDB. Here is my connection
string "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\inetpub\wwwroot\OmniCare\Temp\10000000174_SAMP1_100_20040531.mdb
". I failed when I try to open the connection and got "Unspecified
error" message. I already followed your suggestion and gave user
account change permissions on the folder "Temp". Anything else am I
missing?

Thanks in advance.

lucy
 
P

Patrick.O.Ige

Try any of this:-
Standard security:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User
Id=admin;Password=;"

Workgroup (system database):
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
OLEDB:System Database=system.mdw;"

With password:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
OLEDB:Database Password=MyDbPassword;"

Hope that helps
Patrick
 
L

lucy

I tried standard security and workgroup connection string and I got the
same error message. The third option won't work in my scenario. What
I'm trying to accomplish as whole is to create a Access database,
append tables and insert records into tables on the fly and save
database file in a temp folder on the web server, then compress
database file into a zip file, download zip file to end user's local
machine.
I'll include the error message on the page as well:
Server Error in '/OmniCare' Application.
--------------------------------------------------------------------------------

Unspecified error
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:


Line 292:
Line 293: 'Open the connection.
Line 294: cn.Open()
Line 295:
Line 296: 'Use a variable to hold the SQL statement.


Source File: C:\Inetpub\wwwroot\OmniCare\LocalDir.aspx.vb Line: 294

Stack Trace:


[OleDbException (0x80004005): Unspecified error]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()
OmniCare.LocalDir.ConnectDB() in
C:\Inetpub\wwwroot\OmniCare\LocalDir.aspx.vb:294
OmniCare.LocalDir.cmdOK_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\OmniCare\LocalDir.aspx.vb:83
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573

thanks

lucy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top