Results 1 to 3 of 3
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    function checkconn error 3044


    I'm having a little trouble i need some help with. i've done some searching and so far havent found any help but hey, i did find some good articles and code to read later
    I have my FE being rolled out and installed on the users desktop but it seems that the first time thru i'm getting an error 3044 in this function that is in my relinking module. Its a commonly used function so i figured someone out there would have had the same problem And posted a solution but so far i haven't found it. in my mind, i could and have been wrong but the way this is wrote i shouldn't see any errors to the users. I added the second condition myself just trying to trap the 3044 but it still goes straight to the system error message. anyone have any ideas, what i may be doing wrong, a better way of checking for connection or a better way to trap it? My only solution at this point that has avoided the error is if i can go to the computer(not all users are at my location or state for that matter) and comment it out the first time or manually link it which seems like a pain to ask my users to do.


    Code:
    '***************************************
    '  Returns True if table can be located
    '***************************************
    Public Function CheckConn(TableName As String) As Boolean
    ''On Error Resume Next
        Dim rs As DAO.Recordset
        
        ' Open linked table to see if connection information is correct.
        Set rs = CurrentDb.OpenRecordset(TableName)
        
        ' If there's no error, return True
        If Err.Number = 0 Then
            CheckConn = True
        ElseIf Err.Number = 3044 Then
            CheckConn = False
        Else
            CheckConn = False
        End If
        
        rs.Close
        Set rs = Nothing
        
        
    End Function

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You can't trap an error like that, because code does not continue after a run-time error. You need to use an OnError go to ...., something like this:

    Code:
    '***************************************
    '  Returns True if table can be located
    '***************************************
    Public Function CheckConn(TableName As String) As Boolean
        On Error Go to ErrTrap
        Dim rs As DAO.Recordset
        
        ' Open linked table to see if connection information is correct.
        Set rs = CurrentDb.OpenRecordset(TableName)
        
        ' If there's no error, return True
        CheckConn = True
        rs.Close
        Set rs = Nothing
        exit function
    ErrTrap:    
        CheckConn = False
        set rs=nothing
    
        
    End Function
    This returns False for any error; you will have to modify it if you want to do something special for Error 3044.

  3. #3
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    Thanks John, that makes sense. i've used this function for many things and this is the only time i've ever had trouble with it. i'll modify it tonight and give it a try.

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

Similar Threads

  1. Run-time error '3044'
    By MarkMcAllister in forum Forms
    Replies: 3
    Last Post: 05-07-2015, 06:25 PM
  2. Replies: 2
    Last Post: 09-15-2014, 10:31 AM
  3. Access 2010 Error 3044 when using shortcut
    By Bill Garner in forum Access
    Replies: 1
    Last Post: 12-10-2012, 02:10 PM
  4. Run-time error '3044'
    By niacin in forum Programming
    Replies: 3
    Last Post: 03-31-2012, 09:26 AM
  5. Run-Time Error 3044 - Invalid Path?
    By KrenzyRyan in forum Import/Export Data
    Replies: 8
    Last Post: 01-19-2011, 10:03 AM

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