Results 1 to 11 of 11
  1. #1
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244

    Network Error 3043

    Hi Every One!



    I have linked database on network with be and fe distributed applications. There is a function which checks for certain activity on the form timer Event and Updates the be.

    Sometime Application gets the 3043 Error saying that there is network problem and that database needs to be closed and re-opend, which makes lot of hassel for users to close and re-open (to refresh the links) the Applicaation:

    Code:
    Private Sub Form_Timer()
    On Error GoTo ErrorHandler
       
    .
       .
       . 
    ' code for UPDATE database goes here
       .
       .
     
    ExitProcedure:
        Exit Sub
     
    ErrorHandler:  
        DisplayError "Form_Timer", Me.Name
        Resume ExitProcedure
    End Sub 
    How can I trap the Error 3043 and Re-Link the tables to if this Error occurs?

    Many thanks!

    _______________
    Khalid Afridi

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you disable the timer event while you are updating the database? What happens if you get another timer event while the first event is still executing?

  3. #3
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Hi RuralGuy!
    Thanks for reply, I am not disabling the timer event while updating the database, actually this code is doing the following tasks:

    1 - Call the function to backup the database every day on 3:00pm
    2 - Call Function to Calculate the pending Request from user and show them on Admin panel
    3 - Call the function when user read Admin message which is already sent by Admin to user
    4 - If Message Receive from User then open the form a show the message and update the table that Admin read the msg.
    5 - Call the function when user exit and Update the table

    Code:
    Private Sub Form_Timer()
    On Error GoTo ErrorHandler
    
    Call BackupDatabase ' Call the function to backup the database
    Me!txtTotReq.Value = CountLocReq() & "  Pending Req" ' Call Function to Calculate the pending Request from user and show them on Admin panel
    
    If TempVars!gRead Then
        Call MsgConfirm ' Call the function when user read Admin message which is already sent by Admin to user
        If GotMessage() Then ' If Message Receive from User then open the form a show the message and update the table that Admin read the msg
            Dim strSQL As String
            Dim rs As DAO.Recordset
            Dim db As DAO.Database
            Set db = CurrentDb
             strSQL = "SELECT ID, tmpFrom, tmpUserName, txtMessage, UserReadMsg From TempUser_T  WHERE tmpUserName = '" & TempVars!gUserName & "'"
             strSQL = strSQL + " AND UserReadMsg = False"
                  
            Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
            If rs.RecordCount > 0 Then
                DoCmd.OpenForm "SendMsg_F"
                Forms!SendMsg_F.txtMsgFrom.Value = rs!txtMessage
                Forms!SendMsg_F.txtFrom.Value = rs!tmpFrom
                Forms!SendMsg_F.cmbAdmin.Value = rs!tmpFrom
                'chkmark for msg read
                DoCmd.SetWarnings False
                DoCmd.RunSQL "UPDATE TempUser_T SET  TempUser_T.UserReadMsg = -1 WHERE TempUser_T.ID = " & rs!ID
                DoCmd.SetWarnings True
            End If
            rs.Close
            Set rs = Nothing
    
        End If
    End If
    
    If Exit_user() = True Then ' call the function when user exit and Update the table
    
        Call SaveUserInfo("out") 'save user info
        Application.Quit acSaveYes
    End If
    
    If Exit_all() = True Then ' function if all users want to be kickedd
    
        Call SaveUserInfo("out") 'save user info
        Application.Quit acSaveYes
    End If
    
    
    ExitProcedure:
        Exit Sub
    
    ErrorHandler:
        DisplayError "Form_Timer", Me.Name
        Resume ExitProcedure
    
    End Sub
    This Error comes only when there is a Network problem or Server is disconnected. Database need to re-establish the link and its only possible once you close the database and re-start the application.

    So is there any way to re-link the tables without closing the database once ERROR 3034 occurs.

    Many thanks

    Khalid

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would still set the TimerInterval to 0 at the beginning of the code and restore your TimerInterval when the code exits.

  5. #5
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Quote Originally Posted by RuralGuy View Post
    I would still set the TimerInterval to 0 at the beginning of the code and restore your TimerInterval when the code exits.
    If I will set the TimerInterval to 0 at the beginning of the code then what happes, the code will not run at all. How do I know that the server is okay and the links are established?
    Do you mean I should make another timer on another form which should check if the links are estiblished?

    How if I write the code?
    Code:
    IF Err.Number = 3034 then
          TimerInerval = 0
          Else: TimerInterVal = 10000
    End IF
    How do I know if Network is Okay? Can you guide me please.
    Thanks

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's what I'm suggesting:
    Code:
    Private Sub Form_Timer()
    Me.TimerInterval = 0 '-- Disable the interrupt
    On Error GoTo ErrorHandler
       .
       .
       .  code for UPDATE database goes here
       .
       .
     
    ExitProcedure:
        Me.TimerInterval = 10000 '-- Turn the interrupt back on
        Exit Sub
     
    ErrorHandler:  
        DisplayError "Form_Timer", Me.Name
        Resume ExitProcedure
    End Sub

  7. #7
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Dear RuralGul thanks for reply,

    This idea is good to stop the Timer and do the job, but this TimerInterval will be 0 until ExitProcedure, which mean that if there is an Error occurs,
    which is not the solution.

    You know:
    There is a chat panel I created for users, where they can directly chat with Admin (me) through the Work Order Application (they can send msgs and receive)
    Admin can send msg to them individually or all users through the application and a popup form will appear on their screen telling them "You got Msg from Admin"
    If they have any problem using the application,they also can send msg to Admin using the same form and Admin will receive their msg After 10 Second TimerInterval
    so if I disable the timer until Error occur, the whole scenario is useless.

    There are also some others tasks which timer form is doing like getting automatic back of the database every day after 3:00 pm.

    Tell me now what to do ???

    Khalid Afridi

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Access is *not* multi-threaded and is certainly not re-entrant code. You can not allow another timer interrupt to happen until you have serviced the one you are in. If your code takes longer that the interval for the event you could easily be causing the error you are seeing. Shutting off the timer interrupt might just resolve your issue and will certainly not hurt anything.

  9. #9
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Thanks RuralGuy for your reply

    After long time I am again here , you are right access not a multi threading application. I disable the un-neccessary messaging modules and increase the TimerInerval so ther is less load on the network and records currption.

    Thanks again
    Khalid Afridi

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great! Are you ready to use the Thread Tools and mark this thread as Solved?

  11. #11
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Quote Originally Posted by RuralGuy View Post
    Great! Are you ready to use the Thread Tools and mark this thread as Solved?

    Hi Rural,
    The original problem of re-linking the links is still persists; I want to re-link the front-end links without closing the application and opening it again, whenever the Network Error 3043 occurs.

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

Similar Threads

  1. can not access over network using runtime
    By Kris Jones in forum Access
    Replies: 1
    Last Post: 03-03-2010, 09:56 PM
  2. MS-access share on network
    By miziri in forum Forms
    Replies: 1
    Last Post: 02-17-2010, 12:28 PM
  3. Network management
    By pandreas in forum Queries
    Replies: 0
    Last Post: 06-12-2009, 03:54 PM
  4. Access over network
    By hornsby in forum Access
    Replies: 2
    Last Post: 01-06-2009, 02:38 PM
  5. Replies: 0
    Last Post: 05-24-2006, 09:26 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