Visual Basic run-time error '-2147221164 (80040154)'

P

Paris

the last few days i receive the following error
Microsoft Visual Basic

run-time error '-2147221164 (80040154)'

class not registerd

with options End - Debug - Help (pressing Help a get en empty Help Window)

it hapends if i open an access database with a swichboard during the
swithboard opening.

if i press debug the "problem" is in the line

rs.Open stSql, con, 1 ' 1 = adOpenKeyset

of sub FillOptions

it happends even if i start a blank database and create a new swichboard
without any data

can anyone HELP me ?

-----------------------------------------------------------------------------------------------------------------------

all the sub FillOptions is:

Private Sub FillOptions()
' Fill in the options for this switchboard page.

' The number of buttons on the form.
Const conNumButtons = 8

Dim con As Object
Dim rs As Object
Dim stSql As String
Dim intOption As Integer

' Set the focus to the first button on the form,
' and then hide all of the buttons on the form
' but the first. You can't hide the field with the focus.
Me![Option1].SetFocus
For intOption = 2 To conNumButtons
Me("Option" & intOption).Visible = False
Me("OptionLabel" & intOption).Visible = False
Next intOption

' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset

' If there are no options for this Switchboard Page,
' display a message. Otherwise, fill the page with the items.
If (rs.EOF) Then
Me![OptionLabel1].Caption = "There are no items for this switchboard
page"
Else
While (Not (rs.EOF))
Me("Option" & rs![ItemNumber]).Visible = True
Me("OptionLabel" & rs![ItemNumber]).Visible = True
Me("OptionLabel" & rs![ItemNumber]).Caption = rs![ItemText]
rs.MoveNext
Wend
End If

' Close the recordset and the database.
rs.Close
Set rs = Nothing
Set con = Nothing

End Sub

-----------------------------------------------------------------------------------------------------------------------
 
J

Jeff Conrad

in message:
the last few days i receive the following error
Microsoft Visual Basic

run-time error '-2147221164 (80040154)'

class not registerd

with options End - Debug - Help (pressing Help a get en empty Help Window)

it hapends if i open an access database with a swichboard during the
swithboard opening.

if i press debug the "problem" is in the line

rs.Open stSql, con, 1 ' 1 = adOpenKeyset

of sub FillOptions

it happends even if i start a blank database and create a new swichboard
without any data

can anyone HELP me ?

In two previous issues where I have seen this problem, installing
MDAC 2.8 fixed the problem. You might give that a try.

http://www.microsoft.com/downloads/...e3-c795-4b7d-b037-185d0506396c&DisplayLang=en
 
P

Paris

thanks Jeff but i tried to insall MDAC 2.8 and i received the mesage that it
isn't for my OS (XP PRO SP2). it mentioned that is included in OS...
 

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