spikepl
Eledittingent Beliped
- Local time
- Today, 04:07
- Joined
- Nov 3, 2010
- Messages
- 6,142
A2007, WinXp.
UserA: Local frontend, Backend in local folder that is shared
User B: Local frontend, linked to the shared folder on User A's machine
Problem:
On startup, each FE reads the location of the BE from a local .INI file and runs this code:
	
	
	
		
 UserA: Local frontend, Backend in local folder that is shared
User B: Local frontend, linked to the shared folder on User A's machine
Problem:
- User A starts up FE first. When User B starts up, Access hangs, but opens if User A closes FE. (I do not know specifically where it hangs - all this is by phone)
- If User B starts up FE first, User A can startup his FE without problem.
On startup, each FE reads the location of the BE from a local .INI file and runs this code:
		Code:
	
	
	Public Function LinkTableDefs()
    Dim dbs As DAO.Database
    Dim tdf As DAO.TableDef
    If gcfHandleErrors Then On Error GoTo LinkTableDefs_Error
    LinkTableDefs = False
    If Dir(TempVars("BE_Location").Value) <> "" Then
        Set dbs = CurrentDb()
        ' Loop through TableDefs collection, only processing ' the table if it already has a Connection property. ' (all other tables are local ... not linked)
        For Each tdf In dbs.TableDefs
            If tdf.Connect <> "" Then
                If tdf.Connect <> ";DATABASE=" & LinkTableDefs Then
                    tdf.Connect = ";DATABASE=" & TempVars("BE_Location").Value
                    tdf.RefreshLink
                End If
            End If
        Next
        
        LinkTableDefs = True
    Else
    
        MsgBox "Could not connect to " & TempVars("BE_Location").Value & vbCrLf & _
        "Check location and content of .INI file and the network", vbInformation
    End If
    
LinkTableDefs_Exit:
    On Error Resume Next
    Exit Function
LinkTableDefs_Error:
    Select Case Err.Number
        Case Else
            MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure LinkTableDefs of Module Relinker"
            Resume LinkTableDefs_Exit
    End Select
End Function
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
		
			
		
		
	
								
							
							 
	 
 
		 
 
		 
  
 
		 
 
		 
 
		 
 
		