Error Class not Registered (ADO)

Michelangelo

Registered User.
Local time
Today, 05:12
Joined
Dec 20, 2002
Messages
37
Hi,

I'm using a piece of code I found at mvps. And uptil now it has worked perfectly. It resets the autonumber of a table to a specified number.

Code:
Function ChangeSeed(strTbl As String, strCol As String, LngSeed As Long) As Boolean
'You must pass the following variables to this function.
'strTbl = Table containing autonumber field
'strCol = Name of the autonumber field
'LngSeed = Long Integer value you want to use for the next AutoNumber

Dim cnn As ADODB.Connection
Dim cat As New ADOX.Catalog
Dim col As ADOX.Column

'Set connection and catalog to current database
Set cnn = CurrentProject.Connection
cat.ActiveConnection = cnn
Set col = cat.Tables(strTbl).Columns(strCol)
' sorry missed these when typing original post
col.Properties("Seed") = LngSeed
cat.Tables(strTbl).Columns.Refresh
If col.Properties("Seed") = LngSeed Then
    ChangeSeed = True
Else
    ChangeSeed = False
End If
Set col = Nothing
Set cat = Nothing
Set cnn = Nothing
End Function


However, I think it's after a windows update, I now get the message that says "class not registered". In debugging mode it fails on the first line "Set cnn = CurrentProject.Connection".

Are there any solutions?

Thanx
 
Do you have the ActiveX Data Objects library selected when you go to Tools, References... in module view?
 
Yes I have, version 2.5 it says. There is nothing in this list that indicates that this is missing.
 
Hmmm ... might I suggest going to the Microsoft website and do a search on CurrentProject ADO. I came up with a wealth of info that will get you going in the right direction.
 
Looked on the microsoft website. But nothing fixed the problems, none added to ;)

I find that the currentproject.connection class is not registered.
The strange thing is that it passes the dim cnn as ADODB.Connection declaration without an error, but it gives the class not registered error when setting it.

I reregistered the msado15.dll -> no fix
I reinstalled MSJET 4.0 -> no fix
Checked MDAC (v2.5 sp3) should be no problem -> no fix


What can I do? :confused:

Is msado15.dll the right dll

Any further help is greatly appreciated

M.
 
Do you have the Microsoft Access 10.0 OLE DB Service Provider as a selected reference?
 
MDAC

You said :

Checked MDAC (v2.5 sp3) should be no problem -> no fix

Does that mean that you ran the MS Component Checker against your system and looked at the results in the OLEDB section also? If not, please run the checker and verify that your dll's are ok. If you did, then ignore this. If not, then download the Component Checker @

http://msdn.microsoft.com/library/default.asp?url=/downloads/list/dataaccess.asp
 
Do you have the Microsoft Access 10.0 OLE DB Service Provider as a selected reference?
No, and it isn't in the list either. What does it do and if needed, where can I get it.

Does that mean that you ran the MS Component Checker against your system and looked at the results in the OLEDB section also? If not, please run the checker and verify that your dll's are ok. If you did, then ignore this. If not, then download the Component Checker @
Indeed I ran the Component Checker. But thanks to your reply I noticed that three files have no more info than the filename, so no versionnumber etc.
They are,

msdart.dll
msdaorar.dll
msorc32r.dll

Rings a bell???
 
Do you have:
Microsoft ADO Ext. for DDL and Security
as a selected reference?

I tell ya, I'm at a loss. I get it to compile no prob from the same config you have.

My other References besides the one above:
Microsoft ActiveX Data Objects 2.5 Library
Visual Basic for Applications
Microsoft Access 9.0 Object Library

Try creating a new DB and compile this code in there with these references. You may be having a cross conflict between a library (although it should tell you that).

Let us know how that turns out.
 
Yes I have Microsoft ADO Ext. for DDL and Security selected. And the others you mentioned.

Tried it several times with new db's. Even un and re installed office. No luck.

I also found out that something is wrong with the Microsoft Jet 4.0 provider
When I try to open a table using this provider it return the message that the provider was not found.

So it seems that a lot of connection issues are messed up somehow. But uptil 2 weeks ago, the all worked fine.

I'm now thinking about installing MDAC2.8. However when I read up on this it looks like when I do that, compatability issues occur when I what to run the db on another machine, with 2.5 installed.
As I use this computer for development, i'm not sure its wise to do so.

M.
 
I would agree. Unless you can also roll MDAC 2.8 on the production machines, I would continue to try to resolve this through other means. Do you have a test box that you can roll the MDAC forward on?
 
Hmmm, I could try that. I don't have a dedicated test machine, but something should be possible.

I'll post my findings when I have them.

In the meantime, thanks for your effort to try and solve this issue.

M.
 

Users who are viewing this thread

Back
Top Bottom