Results 1 to 4 of 4
  1. #1
    doddiah is offline Novice
    Windows 8 Access 2007
    Join Date
    Jul 2015
    Posts
    5

    Conversion from Acess 2003 to 2007

    The first Line


    Dim dbs as Database does not work after converting to Acess 2007 from Acess 2003 with a to missing DAO350.dll version 5.0 and it cannot compile the following Sub

    it cannot pass "Dim dbs as Database"

    What should I do to overcome this problem
    Private Sub FillOptions()
    ' Fill in the options for this switchboard page.
    ' The number of buttons on the form.
    Const conNumButtons = 8

    Dim dbs As Database
    Dim rst As Recordset
    Dim strSQL 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 dbs = CurrentDb()
    strSQL = "SELECT * FROM [Switchboard Items]"
    strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
    strSQL = strSQL & " ORDER BY [ItemNumber];"
    Set rst = dbs.OpenRecordset(strSQL)

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

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    Access changed from JET to ACE in 2007 now requires you specify what type of database/object so redeclare as

    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset

    And the library should now be ACEDAO.DLL (Microsoft Office 14.0 Access database engine Objects)

  3. #3
    doddiah is offline Novice
    Windows 8 Access 2007
    Join Date
    Jul 2015
    Posts
    5
    Hi,

    Tried to make this DLL part of the "MISSING" DAO Object in the References tab, but it is still not recognizing it yet are there any other DLL's that need to be present in that .

    directory that I created in Program Files/Common File/Microsoft Shared/DAO

    Alternatively how should I change the code, this is used to populate a switchboard

    Thanks

  4. #4
    doddiah is offline Novice
    Windows 8 Access 2007
    Join Date
    Jul 2015
    Posts
    5
    Tried DAO360.dll and setting the reference helped thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. 2002-2003 to 2007-2013 conversion
    By hennap in forum Access
    Replies: 4
    Last Post: 11-05-2014, 05:54 PM
  2. how to rank using a query in acess 2007
    By BRAYAN RYAN VAN KYAN in forum Queries
    Replies: 1
    Last Post: 08-13-2013, 02:11 AM
  3. Problem in requery of reports in acess 2003
    By pratim09 in forum Reports
    Replies: 1
    Last Post: 08-02-2011, 07:28 AM
  4. Acess 2007 & SQL question
    By willigiann in forum Forms
    Replies: 3
    Last Post: 09-15-2010, 09:54 AM
  5. 2003 to 2007 conversion error
    By paleoman in forum Access
    Replies: 1
    Last Post: 06-22-2010, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums