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

ADO not registered anymore

P: n/a

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.

Function ChangeSeed(strTbl As String, strCol As String, LngSeed As Long) As
'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
If col.Properties("Seed") = LngSeed Then
ChangeSeed = True
ChangeSeed = False
End If
Set col = Nothing
Set cat = Nothing
Set cnn = Nothing
End Function
However, I think it's after a W2K (sp4) update, I now get the message that
says "class not registered". In debugging mode it fails on the first line
"Set cnn = CurrentProject.Connection".

Also all other ADO properties, MSJET stuff don't work. The references are in
place however.

Are there any solutions?

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.