Problem Connecting To Access Database

  • Thread starter Cathleen C via DotNetMonster.com
  • Start date
C

Cathleen C via DotNetMonster.com

I created some very simple ASP.NET applications - form data is entered into
an Access database. There are 4 of these apps - all similar in nature and
even connect to the same database just different tables via stored queries.

All of the apps were working fine on the web server. Then I recently noticed
that a few all of the sudden stopped working. I checked thru the code on my
local machine - where I originally created them, but didn't see any
differences between the ones that worked and the ones that didn't. However
when I attempted to run in debug mode on my local system I started receiving
the same error message for all of them. If I rebuild and copy back to the
server some of them run fine, while others still do not. - there doesn't seem
to be an rhyme or reason.

Here is the error message I receive for one that works on the web server, but
not locally.

Exception Details: System.Data.OleDb.OleDbException: No error information
available: REGDB_E_CLASSNOTREG(0x80040154).

Source Error:


Line 90: // try
Line 91: //{
Line 92: oleHr.Open();
Line 93: oleInsert.Parameters["firstName"].Value = txtFirstName.Text;
Line 94: oleInsert.Parameters["lastName"].Value = txtLastName.Text;


Source File: c:\inetpub\wwwroot\con020\default.aspx.cs Line: 92

Stack Trace:


[OleDbException (0x80040154): No error information available:
REGDB_E_CLASSNOTREG(0x80040154).]

[InvalidOperationException: The 'Microsoft.Jet.OLEDB.4.0' provider is not
registered on the local machine.]
System.Data.OleDb.OleDbConnection.CreateProviderError(Int32 hr)
System.Data.OleDb.OleDbConnection.CreateProvider(OleDbConnectionString
constr)
System.Data.OleDb.OleDbConnection.Open()
con020.WebForm1.cmdSign_Click(Object sender, EventArgs e) in c:\inetpub\
wwwroot\con020\default.aspx.cs:92
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() +1292


Does anyone know what could be causing this inconsistent behavior?
 
C

Cor Ligthert [MVP]

Cathleen,

It is probably something with your access database, are you sure that
increased traffic on your webserver can give the errors?

Just a guess

Cor
 
P

Paul Clement

¤ I created some very simple ASP.NET applications - form data is entered into
¤ an Access database. There are 4 of these apps - all similar in nature and
¤ even connect to the same database just different tables via stored queries.
¤
¤ All of the apps were working fine on the web server. Then I recently noticed
¤ that a few all of the sudden stopped working. I checked thru the code on my
¤ local machine - where I originally created them, but didn't see any
¤ differences between the ones that worked and the ones that didn't. However
¤ when I attempted to run in debug mode on my local system I started receiving
¤ the same error message for all of them. If I rebuild and copy back to the
¤ server some of them run fine, while others still do not. - there doesn't seem
¤ to be an rhyme or reason.
¤
¤ Here is the error message I receive for one that works on the web server, but
¤ not locally.
¤
¤ Exception Details: System.Data.OleDb.OleDbException: No error information
¤ available: REGDB_E_CLASSNOTREG(0x80040154).
¤
¤ Source Error:
¤
¤
¤ Line 90: // try
¤ Line 91: //{
¤ Line 92: oleHr.Open();
¤ Line 93: oleInsert.Parameters["firstName"].Value = txtFirstName.Text;
¤ Line 94: oleInsert.Parameters["lastName"].Value = txtLastName.Text;
¤
¤
¤ Source File: c:\inetpub\wwwroot\con020\default.aspx.cs Line: 92
¤
¤ Stack Trace:
¤
¤
¤ [OleDbException (0x80040154): No error information available:
¤ REGDB_E_CLASSNOTREG(0x80040154).]
¤
¤ [InvalidOperationException: The 'Microsoft.Jet.OLEDB.4.0' provider is not
¤ registered on the local machine.]
¤ System.Data.OleDb.OleDbConnection.CreateProviderError(Int32 hr)
¤ System.Data.OleDb.OleDbConnection.CreateProvider(OleDbConnectionString
¤ constr)
¤ System.Data.OleDb.OleDbConnection.Open()
¤ con020.WebForm1.cmdSign_Click(Object sender, EventArgs e) in c:\inetpub\
¤ wwwroot\con020\default.aspx.cs:92
¤ 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() +1292
¤
¤
¤ Does anyone know what could be causing this inconsistent behavior?

Have you tried compacting and/or repairing the databases. Access databases require periodic
maintenance and if neglected can begin to exhibit problems.

http://support.microsoft.com/default.aspx?scid=kb;en-us;283849

Since you appear to have other Access databases which are functioning properly I'm going to assume
it has nothing to do with the Jet OLEDB provider.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
C

Cathleen C via DotNetMonster.com

Cor said:
Cathleen,

It is probably something with your access database, are you sure that
increased traffic on your webserver can give the errors?

Just a guess

Cor


The forms are not currently being used - only a few test submissions to
ensure they are working as anticipated - so the issue is not related to
increased traffic. None of them seem to work locally, while a few will work
on the web server. Also, when I work on it locally I redirect the connection
string to a local copy of the database and change it back when I build and
copy back to the server. It seems really strange since they were working a
few weeks ago.
 
C

Cathleen C via DotNetMonster.com

Paul said:
¤ I created some very simple ASP.NET applications - form data is entered into
¤ an Access database. There are 4 of these apps - all similar in nature and
¤ even connect to the same database just different tables via stored queries.
¤
¤ All of the apps were working fine on the web server. Then I recently noticed
¤ that a few all of the sudden stopped working. I checked thru the code on my
¤ local machine - where I originally created them, but didn't see any
¤ differences between the ones that worked and the ones that didn't. However
¤ when I attempted to run in debug mode on my local system I started receiving
¤ the same error message for all of them. If I rebuild and copy back to the
¤ server some of them run fine, while others still do not. - there doesn't seem
¤ to be an rhyme or reason.
¤
¤ Here is the error message I receive for one that works on the web server, but
¤ not locally.
¤
¤ Exception Details: System.Data.OleDb.OleDbException: No error information
¤ available: REGDB_E_CLASSNOTREG(0x80040154).
¤
¤ Source Error:
¤
¤
¤ Line 90: // try
¤ Line 91: //{
¤ Line 92: oleHr.Open();
¤ Line 93: oleInsert.Parameters["firstName"].Value = txtFirstName.Text;
¤ Line 94: oleInsert.Parameters["lastName"].Value = txtLastName.Text;
¤
¤
¤ Source File: c:\inetpub\wwwroot\con020\default.aspx.cs Line: 92
¤
¤ Stack Trace:
¤
¤
¤ [OleDbException (0x80040154): No error information available:
¤ REGDB_E_CLASSNOTREG(0x80040154).]
¤
¤ [InvalidOperationException: The 'Microsoft.Jet.OLEDB.4.0' provider is not
¤ registered on the local machine.]
¤ System.Data.OleDb.OleDbConnection.CreateProviderError(Int32 hr)
¤ System.Data.OleDb.OleDbConnection.CreateProvider(OleDbConnectionString
¤ constr)
¤ System.Data.OleDb.OleDbConnection.Open()
¤ con020.WebForm1.cmdSign_Click(Object sender, EventArgs e) in c:\inetpub\
¤ wwwroot\con020\default.aspx.cs:92
¤ 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() +1292
¤
¤
¤ Does anyone know what could be causing this inconsistent behavior?

Have you tried compacting and/or repairing the databases. Access databases require periodic
maintenance and if neglected can begin to exhibit problems.

http://support.microsoft.com/default.aspx?scid=kb;en-us;283849

Since you appear to have other Access databases which are functioning properly I'm going to assume
it has nothing to do with the Jet OLEDB provider.

Paul
~~~~
Microsoft MVP (Visual Basic)

I just tried to compact and repair my local copy of the database and ran one
of the apps that works on the web server, but not locally. I received the
same error when in debug mode. None of the apps are working locally with
the local database, and only some are working on the web server.

Based upon another thread I found, I was going to try reintalling the MDAC
and Jet or run the Component Checker.
 
C

Cathleen C via DotNetMonster.com

I just tried to compact and repair my local copy of the database and ran one
of the apps that works on the web server, but not locally. I received the
same error when in debug mode. None of the apps are working locally with
the local database, and only some are working on the web server.

Based upon another thread I found, I was going to try reintalling the MDAC
and Jet or run the Component Checker.

Neither installation would run - the version I have is newer or all features
are already part of Windows.

The Component Checker came back with MDAC version 2.81 sp1 on XP sp2.
 
C

Cor Ligthert [MVP]

Cathleen,

Are you sure that you are the only one who is able to change permissions and
things like that?

Cor
 
C

Cathleen C via DotNetMonster.com

Cor said:
Cathleen,

Are you sure that you are the only one who is able to change permissions and
things like that?

Cor

Yes, for my local workstation . The network admins can make modifications on
the web server, but since I've taken over they rarely do. Of course, the
problems show up consistently on my local system and no one typically
accesses it but me.

I've been searching for other threads on this issue and found one that
referenced checking the registry for a few Jet values. Both checked out ok.
 
P

Paul Clement

¤ >
¤ >I just tried to compact and repair my local copy of the database and ran one
¤ >of the apps that works on the web server, but not locally. I received the
¤ >same error when in debug mode. None of the apps are working locally with
¤ >the local database, and only some are working on the web server.
¤ >
¤ >Based upon another thread I found, I was going to try reintalling the MDAC
¤ >and Jet or run the Component Checker.
¤
¤ Neither installation would run - the version I have is newer or all features
¤ are already part of Windows.
¤
¤ The Component Checker came back with MDAC version 2.81 sp1 on XP sp2.

Try repairing MDAC:

http://www.macropool.com/en/download/mdac_xp_sp2.html


Paul
~~~~
Microsoft MVP (Visual Basic)
 
C

Cathleen C via DotNetMonster.com

Paul said:
¤ >
¤ >I just tried to compact and repair my local copy of the database and ran one
¤ >of the apps that works on the web server, but not locally. I received the
¤ >same error when in debug mode. None of the apps are working locally with
¤ >the local database, and only some are working on the web server.
¤ >
¤ >Based upon another thread I found, I was going to try reintalling the MDAC
¤ >and Jet or run the Component Checker.
¤
¤ Neither installation would run - the version I have is newer or all features
¤ are already part of Windows.
¤
¤ The Component Checker came back with MDAC version 2.81 sp1 on XP sp2.

Try repairing MDAC:

http://www.macropool.com/en/download/mdac_xp_sp2.html

Paul
~~~~
Microsoft MVP (Visual Basic)

I finally determined the problem. There is an unncessary and poorly written
software application that was installed on my system. Apparently it
sometimes decides to corrupt an OLEDB .dll when the mood strikes it. I re-
registered this and everything is working once again.

Thanks for all your suggestions.
 

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

Top