"Class Not Registered" error

L

Leif

I'm testing an Access 2K application currently running on
Win2K under Office 2003/Access 2003/XP.

I'm getting a "Class not Registered" error when I try to
execute code that has Currentproject.Connection. For
example:

Dim cnn As ADODB.Connection

On Error GoTo Err_cmdOK_Click

' Try to reset the user's password

' *** THE FOLLOWING LINE GETS THE ERROR ***
Set cnn = CurrentProject.Connection
cnn.Execute "ALTER USER [" & CurrentUser & "]
PASSWORD [" & txtNewPassword & _
"] [" & txtCurrentPassword & "]"
Set cnn = Nothing

DoCmd.Close
Exit Sub

Err_cmdOK_Click:
MsgBox Err.Description
Resume Exit_cmdOK_Click

End Sub

I've checked under References, and all the references are
the same as on A2K, except a change from Access Object
Library 9.0 to 11.0 and Microsoft Office 9.0 Object
library to 11.0.

Thanks,
Leif
 
A

Alex Dybenko

Hi Leif,
dont really know the reason of such errors (anybody can explain?)- but try
to use CurrentProject.ActiveConnection instead
 
L

Leif

After making your suggested change I get the error:

438 Object doesn't support this property or method.

-----Original Message-----
Hi Leif,
dont really know the reason of such errors (anybody can explain?)- but try
to use CurrentProject.ActiveConnection instead

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


I'm testing an Access 2K application currently running on
Win2K under Office 2003/Access 2003/XP.

I'm getting a "Class not Registered" error when I try to
execute code that has Currentproject.Connection. For
example:

Dim cnn As ADODB.Connection

On Error GoTo Err_cmdOK_Click

' Try to reset the user's password

' *** THE FOLLOWING LINE GETS THE ERROR ***
Set cnn = CurrentProject.Connection
cnn.Execute "ALTER USER [" & CurrentUser & "]
PASSWORD [" & txtNewPassword & _
"] [" & txtCurrentPassword & "]"
Set cnn = Nothing

DoCmd.Close
Exit Sub

Err_cmdOK_Click:
MsgBox Err.Description
Resume Exit_cmdOK_Click

End Sub

I've checked under References, and all the references are
the same as on A2K, except a change from Access Object
Library 9.0 to 11.0 and Microsoft Office 9.0 Object
library to 11.0.

Thanks,
Leif


.
 
A

Alex Dybenko

at me both way works fine, in ADP of couse. Are we talking about ADP?

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


Leif said:
After making your suggested change I get the error:

438 Object doesn't support this property or method.

-----Original Message-----
Hi Leif,
dont really know the reason of such errors (anybody can explain?)- but try
to use CurrentProject.ActiveConnection instead

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


I'm testing an Access 2K application currently running on
Win2K under Office 2003/Access 2003/XP.

I'm getting a "Class not Registered" error when I try to
execute code that has Currentproject.Connection. For
example:

Dim cnn As ADODB.Connection

On Error GoTo Err_cmdOK_Click

' Try to reset the user's password

' *** THE FOLLOWING LINE GETS THE ERROR ***
Set cnn = CurrentProject.Connection
cnn.Execute "ALTER USER [" & CurrentUser & "]
PASSWORD [" & txtNewPassword & _
"] [" & txtCurrentPassword & "]"
Set cnn = Nothing

DoCmd.Close
Exit Sub

Err_cmdOK_Click:
MsgBox Err.Description
Resume Exit_cmdOK_Click

End Sub

I've checked under References, and all the references are
the same as on A2K, except a change from Access Object
Library 9.0 to 11.0 and Microsoft Office 9.0 Object
library to 11.0.

Thanks,
Leif


.
 

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