By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

Help with IIS server Error (Provider error '80040154' Class not registered)

P: n/a
I am trying to get a total record count on a Acess 97 mdb database. However
I get the following error when I try to load the page:

Provider error '80040154' Class not registered
http://www.assetresearch.com/clog/count.asp

I believe permissions for the IUSR_machine are correct as I am able to add
and delete records from the database through other ASP pages in the site.
Any ideas on what Class needs to be re-registered. If so, how do I do it?

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("clogin.mdb"))
conn.CursorLocation = 3

set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM users"
rs.Open sql,conn

if rs.Supports(adApproxPosition)=true then
i=rs.RecordCount
response.write("The number of records is: " & i)
end if
rs.Close
conn.Close
%>

Any help is this matter is greatly appreciated:)

--
Best Regards,
Martin Franklin
Ma***@AssetResearch.Com

Asset Research Services, Inc.
PO Box 7562
Chandler, Arizona 85246

Phone (800) 783-9636 or (480) 940-4290
Extension 213

Fax (888) 496-5736 or (480) 496-5735

Web: WWW.AssetResearch.Com
Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Martin Franklin wrote:
I am trying to get a total record count on a Acess 97 mdb database.
However I get the following error when I try to load the page:

Provider error '80040154' Class not registered
Which one is line 17?
http://www.assetresearch.com/clog/count.asp

I believe permissions for the IUSR_machine are correct as I am able
to add and delete records from the database through other ASP pages
in the site. Any ideas on what Class needs to be re-registered. If
so, how do I do it?

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("clogin.mdb"))
conn.CursorLocation = 3

set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM users"
rs.Open sql,conn

if rs.Supports(adApproxPosition)=true then
This is the wrong property to check for Supports. It's Bookmarkability that
determines whether or not the cursor supports recordcount. Anyways, you set
cursorLocation to 3 above, so you have a client-side cursor that
automatically supports recordcount because a client-side cursor is always a
Static cursor which supports recordcount.
i=rs.RecordCount
response.write("The number of records is: " & i)
end if
rs.Close
conn.Close
%>

Any help is this matter is greatly appreciated:)

As a guess, you have an Access97 database which uses Jet 3.51, and you are
using the Jet 4.0 provider to open it. I have never had a problem with this,
but then again, I never use the RecordCount property, so this error may have
been waiting in the wings for me all this time.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2

P: n/a
Mr. Barrows

One thing I failed to mention in my original post is the fact that this code
works on my testing server. My problem arises when I try to run the same
page on my ISP's web server. I've actually tested this code on two of my own
web servers without any problems. Line 17 pertains one of the following
lines of code below. My development tool lists line 17 as 'rs.Open sql,
conn' but I believe the true offending line of code pertains to the line
below it 'i-rs.RecordCount' .

rs.Open sql,conn
i=rs.RecordCount

I've further trimmed my code as suggested by removing 'if
rs.Supports(adApproxPosition)=true then' . Thanks for the catch. My new
complete code is...

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("clogin.mdb"))
conn.CursorLocation = 3

set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM users"
rs.Open sql, conn

i=rs.RecordCount
response.write("The number of records is: " & i)

rs.Close
conn.Close
%>

Perhaps my question would be better suited for a form on IIS config. Any
further suggestions are greatly appreciated.

Ma***@assetresearch.com
Martin Franklin


"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uI**************@TK2MSFTNGP14.phx.gbl...
Martin Franklin wrote:
I am trying to get a total record count on a Acess 97 mdb database.
However I get the following error when I try to load the page:

Provider error '80040154' Class not registered
Which one is line 17?
http://www.assetresearch.com/clog/count.asp

I believe permissions for the IUSR_machine are correct as I am able
to add and delete records from the database through other ASP pages
in the site. Any ideas on what Class needs to be re-registered. If
so, how do I do it?

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("clogin.mdb"))
conn.CursorLocation = 3

set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM users"
rs.Open sql,conn

if rs.Supports(adApproxPosition)=true then


This is the wrong property to check for Supports. It's Bookmarkability

that determines whether or not the cursor supports recordcount. Anyways, you set cursorLocation to 3 above, so you have a client-side cursor that
automatically supports recordcount because a client-side cursor is always a Static cursor which supports recordcount.
i=rs.RecordCount
response.write("The number of records is: " & i)
end if
rs.Close
conn.Close
%>

Any help is this matter is greatly appreciated:)

As a guess, you have an Access97 database which uses Jet 3.51, and you are
using the Jet 4.0 provider to open it. I have never had a problem with

this, but then again, I never use the RecordCount property, so this error may have been waiting in the wings for me all this time.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #3

P: n/a
Martin Franklin wrote:
Mr. Barrows

One thing I failed to mention in my original post is the fact that
this code works on my testing server. My problem arises when I try to
run the same page on my ISP's web server. I've actually tested this
code on two of my own web servers without any problems. Line 17
pertains one of the following lines of code below. My development
tool lists line 17 as 'rs.Open sql, conn' but I believe the true
offending line of code pertains to the line below it
'i-rs.RecordCount' .
Have you commented out the line to verify this belief?

rs.Open sql,conn
i=rs.RecordCount

I've further trimmed my code as suggested by removing 'if
rs.Supports(adApproxPosition)=true then' . Thanks for the catch. My
new complete code is...
1> <%
2> set conn=Server.CreateObject("ADODB.Connection")
3> conn.Provider="Microsoft.Jet.OLEDB.4.0"
4> conn.Open(Server.Mappath("clogin.mdb"))
5> conn.CursorLocation = 3
6>
7> set rs=Server.CreateObject("ADODB.recordset")
8> sql="SELECT * FROM users"
9> rs.Open sql, conn
10>
11> i=rs.RecordCount
12> response.write("The number of records is: " & i)
13>
14> rs.Close
15> conn.Close
16> %>
Perhaps my question would be better suited for a form on IIS config.
Any further suggestions are greatly appreciated.


All I can suggest is an MDAC upgrade/repair on the server which is giving
you the problem..

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #4

P: n/a

Bob Barrows [MVP] wrote:
*Martin Franklin wrote:
Mr. Barrows

One thing I failed to mention in my original post is the fact that
this code works on my testing server. My problem arises when I try

to
run the same page on my ISP's web server. I've actually tested

this
code on two of my own web servers without any problems. Line 17
pertains one of the following lines of code below. My development
tool lists line 17 as 'rs.Open sql, conn' but I believe the

true
offending line of code pertains to the line below it
'i-rs.RecordCount' .


Have you commented out the line to verify this belief?

rs.Open sql,conn
i=rs.RecordCount

I've further trimmed my code as suggested by removing 'if
rs.Supports(adApproxPosition)=true then' . Thanks for the catch.

My
new complete code is...

1> <%
2> set conn=Server.CreateObject("ADODB.Connection")
3> conn.Provider="Microsoft.Jet.OLEDB.4.0"
4> conn.Open(Server.Mappath("clogin.mdb"))
5> conn.CursorLocation = 3
6>
7> set rs=Server.CreateObject("ADODB.recordset")
8> sql="SELECT * FROM users"
9> rs.Open sql, conn
10>
11> i=rs.RecordCount
12> response.write("The number of records is: " & i)
13>
14> rs.Close
15> conn.Close
16> %>

Perhaps my question would be better suited for a form on IIS

config.
Any further suggestions are greatly appreciated.


All I can suggest is an MDAC upgrade/repair on the server which is
giving
you the problem..

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a
quicker response by posting to the newsgroup. *


Update: 3/25/05

Found the problem to the 'class not registered' error. I had to extend
the IUSR permissions on the directories that were pointed to by the
TEMP and TMP system variables.

"Note The Microsoft Jet database engine uses the System Temp and Tmp
environment
variables to specify the location of temporary files that are created
during Jet operations."

Posted by Martin Franklin
ma***@assetresearch.com

--
mmfranklin
------------------------------------------------------------------------
Posted via http://www.webservertalk.com
------------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message933177.html

Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more ASP / Active Server Pages Questions on Bytes