Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Location
    Houston, TX
    Posts
    4

    Unanswered: CurrentProject.Connection Run time Error

    When attempting to start a switchboard form in MS Access 2002 SP3 I get the following error:
    "Run Time Error 430
    Class does not support automation or does not support expected interface"

    I am running this on a Windows XP SP2 machine. It was working fine the last time I used it a couple of months ago. I do not know what has changed on the system.

    Dim cnn As Object
    Dim rst As As Object
    Dim strSql As String

    Set cnn = Application.CurrentProject.Connection
    strSql = "SELECT * FROM [Switchboard Items]"
    strSql = strSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
    strSql = strSql & " ORDER BY [ItemNumber];"
    Set rst = CreateObject("ADODB.Recordset")
    rst.Open strSql, cnn, 1 ' 1 = adOpenKeyset

    I am getting the error with the Application.currentproject.connection. Does anyone know whot could be causing this?

    Thanks
    Eric

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Try this:
    Code:
    Dim cnn AS New ADODB.Connection
    Dim rst AS New ADODB.Recordset
    Dim strSql as String
    
    Set cnn = Application.CurrentProject.Connection
    strSql = "SELECT * FROM [Switchboard Items]"
    strSql = strSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
    strSql = strSql & " ORDER BY [ItemNumber];"
    rst.Open strSql, cnn, 1 ' 1 = adOpenKeyset
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •