Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    VA
    Posts
    24

    Question Unanswered: Error Accessing File. Network connection may have been lost

    Hi guys, I was wondering if you guys ever get the message
    "Error Accessing File. Network connection may have been lost".

    I copied my database to a different location and when the user type in their user ID, it is suppose to open their forms. It worked when it is an MDE file when i first created on it's previous location but now that the location has been moved, it seems like it doesn't know where to point to. the code is down below. Thanks for any assistance you guys can give.

    Private Sub Command4_Click()
    Dim db As Database
    Dim StUserID
    Dim StPassword
    Dim StDivisionCat
    Dim rec As DAO.Recordset
    Dim IntCount As Integer

    Set db = CurrentDb()
    Set rec = db.OpenRecordset("USER")

    Dim x As Integer
    IntCount = rec.RecordCount

    Dim Admin As String
    Dim AIS As String
    Dim AIO As String
    Dim LOB As String
    Dim PCB As String

    '*******************************name of forms to retrieve***************
    Admin = "AdministratorMain"
    AIS = "AIS_Main"
    AIO = "AIO_Main"
    LOB = "LOB_Main"
    PCB = "PCB_Main"
    '************************************************* ******************

    Dim stname As String
    stname = "closeLOGIN"

    For x = 0 + 1 To IntCount
    Set StUserID = rec.Fields("userid")
    Set StPassword = rec.Fields("password")
    Set StDivisionCat = rec.Fields("division_category")
    If StUserID = Me!UserName Then

    If StPassword = Me!UserPassword Then
    Select Case StDivisionCat
    Case "Admin"
    DoCmd.OpenForm Admin
    Case "Ais"
    DoCmd.OpenForm AIS
    Case "Aio"
    DoCmd.OpenForm AIO
    Case "lob"
    DoCmd.OpenForm LOB
    Case "PC&B"
    DoCmd.OpenForm PCB
    End Select

    '************************runs a macro that closes the login screen*************
    Dim stDocName As String
    stDocName = "closeLoginScreen"
    DoCmd.RunMacro stDocName
    '************************************************* *********************
    Exit Sub

    Else
    MsgBox "You have enter an invalid Password"

    End If
    Else
    End If

    rec.MoveNext
    Next
    rec.Close

    MsgBox "You do not have access to login, you either typed in the wrong ID or password. Please try again"
    End Sub

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Error Accessing File. Network connection may have been lost

    When does the error occur, before the login form opens or when the button for the code is clicked.


    Originally posted by sopheapteng
    Hi guys, I was wondering if you guys ever get the message
    "Error Accessing File. Network connection may have been lost".

    I copied my database to a different location and when the user type in their user ID, it is suppose to open their forms. It worked when it is an MDE file when i first created on it's previous location but now that the location has been moved, it seems like it doesn't know where to point to. the code is down below. Thanks for any assistance you guys can give.

    Private Sub Command4_Click()
    Dim db As Database
    Dim StUserID
    Dim StPassword
    Dim StDivisionCat
    Dim rec As DAO.Recordset
    Dim IntCount As Integer

    Set db = CurrentDb()
    Set rec = db.OpenRecordset("USER")

    Dim x As Integer
    IntCount = rec.RecordCount

    Dim Admin As String
    Dim AIS As String
    Dim AIO As String
    Dim LOB As String
    Dim PCB As String

    '*******************************name of forms to retrieve***************
    Admin = "AdministratorMain"
    AIS = "AIS_Main"
    AIO = "AIO_Main"
    LOB = "LOB_Main"
    PCB = "PCB_Main"
    '************************************************* ******************

    Dim stname As String
    stname = "closeLOGIN"

    For x = 0 + 1 To IntCount
    Set StUserID = rec.Fields("userid")
    Set StPassword = rec.Fields("password")
    Set StDivisionCat = rec.Fields("division_category")
    If StUserID = Me!UserName Then

    If StPassword = Me!UserPassword Then
    Select Case StDivisionCat
    Case "Admin"
    DoCmd.OpenForm Admin
    Case "Ais"
    DoCmd.OpenForm AIS
    Case "Aio"
    DoCmd.OpenForm AIO
    Case "lob"
    DoCmd.OpenForm LOB
    Case "PC&B"
    DoCmd.OpenForm PCB
    End Select

    '************************runs a macro that closes the login screen*************
    Dim stDocName As String
    stDocName = "closeLoginScreen"
    DoCmd.RunMacro stDocName
    '************************************************* *********************
    Exit Sub

    Else
    MsgBox "You have enter an invalid Password"

    End If
    Else
    End If

    rec.MoveNext
    Next
    rec.Close

    MsgBox "You do not have access to login, you either typed in the wrong ID or password. Please try again"
    End Sub

  3. #3
    Join Date
    Nov 2002
    Location
    VA
    Posts
    24
    Hi, thanks for the respond. It actually happend when i click the button. I think something happend to the server over the weekend because i went to my backup file and it works. The code that i worked on the day before works but the code i didn't touch gave me that network error message. Do you think when i was working on my project and something happened to the server that day that it caused a corruption to my project because you know where you click on the tools repair or compact database, it gave me the same error. I also couldn't go into the code and type things on there, it would let me view but not change the code. If you know what happened, that would be great thanks

  4. #4
    Join Date
    Oct 2002
    Posts
    12
    I have had this error happen on a few of my network machines. After much reserach it turned out the problem was with the idividual machines. Some machines that had office 2000 loaded and then had an 2002 office product of any type installed caused this error to happen. It also happened "down the road" after the products had been installed. I believe this has been fixed with the current service pack for Offfice 2k. Hope this helps.

  5. #5
    Join Date
    Nov 2002
    Location
    VA
    Posts
    24
    Thanks for your reply ryanesnow.

Posting Permissions

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