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

From: Martin Franklin (Marty_at_assetresearch.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 08:55:17 -0700

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.

Marty@assetresearch.com
Martin Franklin

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:uIfnRUtGFHA.2136@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"
>
>



Relevant Pages

  • Re: VB connection to SQL server
    ... > the client machine begins to lose its relevance and accuracy as soon as it ... > aware that the data is probably out of date, a client sided cursor might ... > design minimises the possibility that records will have changed in the ... >> The Database server is in the office, and people use the Vb program from ...
    (microsoft.public.vb.database)
  • Re: Huge memory comsumption of ADODB Connection object
    ... unless the cursor is returning data to the client* I don't see ... I suppose this could cause some extra memory ... Is there a similar behavior in Sybase? ... Server was originally based on that rdbms, so there very well may be. ...
    (microsoft.public.data.ado)
  • Re: VB connection to SQL server
    ... "Chris Barber" wrote in message ... > recordsets (client side cursor) to allow you to persist the recordsets to ... aware that the data is probably out of date, a client sided cursor might fit ... That is because the SELECT statement is executed on the server and the data ...
    (microsoft.public.vb.database)
  • Re: Accessing A Large MS SQL Table Over ADO Components
    ... Client-side cursor fetches all rows, ... Because I had some performance loss when I set it up to Server ... Server-side cursor does not fetch all rows to client, so if server is on the ... > If we want to display the data on a readonly grid wich component is the ...
    (borland.public.delphi.database.ado)
  • Re: ADO server side cursor sloooow
    ... Using the ODBC driver my tests show that both client and server side ... forward only server side cursor is faster than a client side cursor as ... requiring over 1000 trips over the network. ...
    (comp.databases.btrieve)