Split Database (Front / Back end) and create MDE file

Cosmos75

Registered User.
Local time
Today, 10:05
Joined
Apr 22, 2002
Messages
1,281
I have created a database using Access 2000 (Regular not Developer). The user only has the runtime version of Access 2000.

I would like to split the database into a front end and back end and make it an MDE file. Are both ends going to be an MDE? Never split a database nor created an MDE file before.

If I do split it and create an MDE file, will I have problems trying to link the two together later if they want to save it differently than I have. Not sure if both will be on the same computer OR back end on network and front end on computer.

I'd like to split it since it will be easier for me to add new reports/queries/forms.

Any comments? opinions? suggestions? warnings? things to look out for?
 
Last edited:
Cos:

I recently split an Access 2000 db, converted the front-end to an MDE used the attached db to disable the shift and F11 keys and sent the database upstairs to be used by a Customer Service Department...so far everything is going good, not a single complaint.

Question for you, if you create new Reports, Queries and Forms, your going to have to re-distribute the db to everyone. Are there a number of people getting the db?
 

Attachments

jfgambit,

I assume you mean having to redistribute the front end of the database, correct?

Well, right now there will be only one person using the database. But there probably will come a time when more than one person would be using it. Even if only one person was using it, it still would be much easier to have them split as all I need to replace would be the front end as needed. Or am I wrong?
 
Yes...

And yes. In cases where there are only a few people, then this would be the best practice.

Good Luck
 
VBA Code to Relink / Reconnect Front and Back End if location changes

OK, I've figured out that I have to use VBA code to relink the front end and back end should the locations change.

Anybody have links to site that may discuss this or have some sample code?
 
There is an example that you can start with in solutions.mdb. I would also suggest using the CommonDialog API rather than the ActiveX control to let the users find the new be. If you don't have solutions or can't find the knowledgebase article on the CD API, search the archives here. I've posted both numerious times.
 
Found it, I think you mean the Link Table at Startup example.

Will go through the code and post back any changes I make to the code.

THANKS, PAT!!
 
Last edited:
Does anybody know if that Link Table at Startup example from the solutions mbd will work from a runtime version of Access 2000?

I've checked the references but have no idea if the user has all of them and what to do it they don't?
:confused: :(
 
I don't know for sure but I don't see why not. The things that don't work with the runtime are the things that involve modifying objects.
 
Code to link Front and Back end - from fornation?

Here's I word document I have tucked away on my hard drive that I probably copied from here but I can't seen to find that post.

Has come code that fornation uses. Warning, it's LONG! (Have to use two posts!! - maybe that's why I can't find it any more) And I haven't tried it but it looks somewhat similiar to the one in the solutions database

PHP:
HERES THE CODE I'VE USED IN THE PAST.
GET YOUR COPY READY BECAUSE THIS IS MASSIVE


'. ==================================================
=======================
'.Table Links Module (main module for Auto Linker)
'.Copyright 1999 Tribble Software. All rights reserved.
'.Phone : (616) 455-2055
'.E-mail : [email]carltribble@earthlink.net[/email]
'. ==================================================
=======================
Option Compare Database
Option Explicit

Private mdb As Database
Private mtbl As TableDef
Private mastrOldLinks() As String
Private mastrNewLinks() As String
Private mfLinkFromUser As Boolean
Private mstrLogFile As String
Private mfDebug As Boolean
Private mstrLog As String
Private mcolNewPaths As Collection
Private mcolPasswords As Collection
Private mfSucceeded As Boolean
Private Const mstrcRunOncePropertyName As String = "tsAutoTableLinkerRunOnce"
Private Const mstrcVersion As String = "1.1"
Private Const strcPasswordForm As String = "ts_frmPassword"
Public Const tscOncePerDatabase As Integer = 1
Public Const tscOncePerSession As Integer = 2
Private Const ecCantFindObject = 3011
Private Const ecInvalidPassword = 3031
Private Const ecPropNotFound As Integer = 3270

Public Function tsCheckTableLinks( _
Optional ByVal fCheckAllLinks As Boolean = True, _
Optional ByVal intRunMode As Integer = 0, _
Optional ByVal strNewPath As String = "", _
Optional ByVal strLogFile As String = "", _
Optional ByVal fDebug As Boolean = False, _
Optional ByVal strPassword As String = "", _
Optional ByVal fShowProgress As Boolean = True, _
Optional ByVal fLetUserCancel As Boolean = False, _
Optional ByVal wrkSecure As Workspace) As Boolean

Dim strMsg As String
Dim strTryLink As String
Dim fSuccess As Boolean
Dim varPath As Variant
Dim fNewPathSucceeded As Boolean
Dim frmProgressMeter As Form_ts_frmProgressMeter
Dim str As String

mstrLog = ""
mfLinkFromUser = False
ReDim mastrOldLinks(9)
ReDim mastrNewLinks(9)

If wrkSecure Is Nothing Then
Set mdb = CurrentDb
Else
Set mdb = wrkSecure.OpenDatabase(CurrentDb.Name)
End If

Set mcolNewPaths = tscolListToCollection(strNewPath)
str = ""
For Each varPath In mcolNewPaths
If Left$(varPath, 8) = "$FE_Dir\" Then
str = str & strDBDir() & Mid$(varPath, 9)
Else
str = str & varPath
End If
If Right$(varPath, 1) <> "\" Then str = str & "\"
str = str & ";"
Next
Set mcolNewPaths = tscolListToCollection(str)

Set mcolPasswords = tscolListToCollection(strPassword)

mstrLogFile = strLogFile
mfDebug = fDebug

LogResult "tsTableLinker has been started with these parameters:"
LogResult " fCheckAllLinks = " & fCheckAllLinks
LogResult " intRunMode = " & intRunMode
LogResult " strNewPath = " & strNewPath
LogResult " strLogFile = " & strLogFile
LogResult " fDebug = " & fDebug
LogResult "------------------------------------------------------"
If intRunMode = tscOncePerDatabase Then
If fGetRunOnce() = True Then
LogResult "We have already run successfully on this database."
LogResult "Run Mode = " & CStr(tscOncePerDatabase) & " (Once per Database) so we are aborting."
LogResult "NOTE: No table links were checked!"
fSuccess = True
GoTo tsCheckTableLinks_End
End If
ElseIf intRunMode = tscOncePerSession Then
If mfSucceeded = True Then
LogResult "We have already run successfully during this session."
LogResult "Run Mode = " & CStr(tscOncePerSession) & " (Once per Session) so we are aborting."
LogResult "NOTE: No table links were checked!"
fSuccess = True
GoTo tsCheckTableLinks_End
End If
End If

If fShowProgress Then
Set frmProgressMeter = New Form_ts_frmProgressMeter
frmProgressMeter.pmInitialize _
intMaximum:=mdb.TableDefs.Count, _
fAllowCancel:=fLetUserCancel, _
strTitle:="Auto Linker v" & mstrcVersion, _
strMainMessage:="Please wait while necessary connections to external " _
& "data tables are checked. Any that are missing must be located " _
& "before this program can operate correctly."
End If

For Each mtbl In mdb.TableDefs
If InStr(mtbl.Connect, ";DATABASE=") <> 0 Then
If fShowProgress Then
If Not frmProgressMeter.pmIncrement( _
strIncrementMessage:="Checking table: " & mtbl.Name) Then
Beep
If MsgBox("The process is not finished. If you cancel now, your " _
& "program may not operate properly.@@Are you sure you want to " _
& "cancel the Auto Linker?", vbYesNo + vbExclamation, "Confirm Cancelation") _
= vbYes Then GoTo tsCheckTableLinks_End
End If
End If
LogProcess "Validating: " & mtbl.Name & " "
If fLinkIsValid(mtbl.Name) Then
LogResult "[OK]"
If Not fCheckAllLinks Then
LogResult "CheckAllLinks was not requested. Since one table"
LogResult "link was found valid, no more will be checked."
fSuccess = True
GoTo tsCheckTableLinks_End
End If
Else
LogResult "[MISSING]"
LogResult "...Checking Cached Links"
If Not fChangeLink(strGetLinkFromCache()) Then
strTryLink = strGetPathFromCache
If strTryLink <> "" Then
strTryLink = strTryLink & strFileName()
LogResult "...Trying Cached Path: Link = " & strTryLink
End If
If Not fChangeLink(strTryLink) Then
strTryLink = ""
fNewPathSucceeded = False
For Each varPath In mcolNewPaths
strTryLink = varPath & strFileName()
LogResult "...Trying NewPath passed: Link = " _
& strTryLink
If fChangeLink(strTryLink) Then
fNewPathSucceeded = True
Exit For
End If
Next
If Not fNewPathSucceeded Then
strTryLink = strFileName()
If strTryLink = "" Then ' it's not a file
strTryLink = strDBDir()
Else
strTryLink = strDBDir() & strTryLink
End If
LogResult "...Trying DB Dir: Link = " & strTryLink
If Not fChangeLink(strTryLink) Then
LogResult "...Asking User"
strMsg = "The linked table """ _
& mtbl.SourceTableName & """ can not be located. " _
& "It used to be in database file or folder """ _
& Mid$(mtbl.Connect, _
InStr(mtbl.Connect, ";DATABASE=") + 10) _
& """. Do you want to try to find it yourself?" _
& "@Click 'Yes' to search for the file or folder " _
& "that contains this table." _
& "@Click 'No' if you are not sure what to do. " _
& "NOTE: If you click 'No' the database may not " _
& "operate correctly."
Beep
Do While MsgBox(strMsg, vbExclamation + vbYesNo, _
"Invalid Table Link") = vbYes
If fChangeLink(strGetLinkFromUser()) Then Exit Do
Loop
If Not fLinkIsValid(mtbl.Name) Then _
GoTo tsCheckTableLinks_End
End If
End If
End If
End If
End If
Else
frmProgressMeter.pmIncrement
End If
Next
fSuccess = True

tsCheckTableLinks_End:
On Error Resume Next
tsCheckTableLinks = fSuccess
mfSucceeded = fSuccess
If intRunMode = tscOncePerDatabase Then SetRunOnce fSuccess
frmProgressMeter.pmClose
Set frmProgressMeter = Nothing
If Not fSuccess Then
Beep
'HERE HERE HERE
MsgBox "The database cannot operate without a relevant data file" & _
"Y2K9 will now close, please link the datasource later by re-opening."
DoCmd.Quit
End If
Set mdb = Nothing
WriteLogFile
On Error GoTo 0
Exit Function

tsCheckTableLinks_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.tsCheckTableLinks"
Resume tsCheckTableLinks_End

End Function
 
Part two!

PHP:
Private Function fLinkIsValid(strTable As String) As Boolean

Dim var As Variant

On Error Resume Next
var = mdb.TableDefs(strTable).Fields(0).Name
If Err <> 0 Then
fLinkIsValid = False
Else
fLinkIsValid = True
End If
On Error GoTo 0

End Function

Private Function strDBDir() As String

On Error GoTo strDBDir_Err
Static strDbName As String

If strDbName = "" Then
strDbName = mdb.Name
Do While Right$(strDbName, 1) <> "\"
strDbName = Left$(strDbName, Len(strDbName) - 1)
Loop
End If
strDBDir = UCase$(strDbName)

strDBDir_End:
On Error GoTo 0
Exit Function

strDBDir_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.strDBDir"
Resume strDBDir_End

End Function

Private Function strGetLinkFromCache() As String

On Error GoTo strGetLinkFromCache_Err
Dim strLink As String
Dim I As Integer

strLink = Mid$(mtbl.Connect, InStr(mtbl.Connect, ";DATABASE=") + 10)
For I = 0 To UBound(mastrOldLinks)
If mastrOldLinks(I) = strLink Then
strGetLinkFromCache = mastrNewLinks(I)
Exit For
End If
Next

strGetLinkFromCache_End:
mfLinkFromUser = False
On Error GoTo 0
Exit Function

strGetLinkFromCache_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.strGetLinkFromCache"
Resume strGetLinkFromCache_End

End Function

Private Function strGetLinkFromUser() As String

On Error GoTo strGetLinkFromUser_Err
Static fNotFirst As Boolean
Dim strMsg As String
Dim strLink As String
Dim strFilter As String
Dim lngflags As Long
Dim varNewLink As Variant

strLink = Mid$(mtbl.Connect, InStr(mtbl.Connect, ";DATABASE=") + 10)

strMsg = "New location of " & mtbl.SourceTableName & "?"
If fLinkIsFile() Then
strMsg = strMsg & " (WAS file """ & strLink & """)"
If Left$(mtbl.Connect, 10) = ";DATABASE=" Then ' Access database
strFilter = "Access (*.mdb)" & vbNullChar & "*.mdb" _
& vbNullChar & "All Files (*.*)" & vbNullChar & "*.*"
lngflags = tscFNHideReadOnly Or tscFNLongNames
varNewLink = tsGetFileFromUser( _
strInitialDir:=IIf(fNotFirst, "", strDBDir()), _
strFilter:=strFilter, _
rlngflags:=lngflags, _
strDialogTitle:=strMsg)
Else ' Non-Access database
strFilter = "All Files (*.*)" & vbNullChar & "*.*" _
& vbNullChar & "Excel (*.xl?)" & vbNullChar & "*.xl?" _
& vbNullChar & "HTML (*.htm?)" & vbNullChar & "*.htm?"
lngflags = tscFNHideReadOnly Or tscFNLongNames
varNewLink = tsGetFileFromUser( _
strInitialDir:=IIf(fNotFirst, "", strDBDir()), _
strFilter:=strFilter, _
rlngflags:=lngflags, _
strDialogTitle:=strMsg)
End If
Else
strMsg = strMsg & vbCrLf & "(WAS folder """ & strLink & """)"
varNewLink = tsGetPathFromUser(strHeaderMsg:=strMsg)
End If

If IsNull(varNewLink) Then
strGetLinkFromUser = ""
Else
strGetLinkFromUser = varNewLink
End If

strGetLinkFromUser_End:
fNotFirst = True
mfLinkFromUser = True
On Error GoTo 0
Exit Function

strGetLinkFromUser_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.strGetLinkFromUser"
Resume strGetLinkFromUser_End

End Function

Private Function fChangeLink(strNewLink) As Boolean

On Error Resume Next
Dim varPassword As Variant
Dim strOldLink As String
Dim strOldConnect As String
Dim intErrorType As Integer
Const intcCantFindTable As Integer = 1
Const intcOtherError As Integer = 2

strOldConnect = mtbl.Connect
If strNewLink <> "" Then
strOldLink = tsstrGetItem("DATABASE", mtbl.Connect)
mtbl.Connect = tsstrSetItem("DATABASE", strNewLink, mtbl.Connect)
mtbl.RefreshLink
Select Case Err
Case 0
GoTo fChangeLinkSuccess
Case ecInvalidPassword
mtbl.Connect = tsstrRemoveItem("PWD", mtbl.Connect)
For Each varPassword In mcolPasswords
mtbl.Connect = tsstrSetItem("PWD", varPassword, _
mtbl.Connect, , True)
mtbl.RefreshLink
Select Case Err
Case 0
GoTo fChangeLinkSuccess
Case ecInvalidPassword
Case ecCantFindObject
intErrorType = intcCantFindTable
GoTo fChangeLinkFailure
Case Else
intErrorType = intcOtherError
GoTo fChangeLinkFailure
End Select
Next
DoCmd.OpenForm strcPasswordForm, , , , , acDialog, _
strFileName(strNewLink)
Do While IsFormLoaded(strcPasswordForm)
mtbl.Connect = tsstrSetItem("PWD", _
Forms(strcPasswordForm).txtPWD, mtbl.Connect, , True)
mtbl.RefreshLink
Select Case Err
Case 0
mcolPasswords.Add Forms(strcPasswordForm).txtPWD
GoTo fChangeLinkSuccess
Case ecInvalidPassword
Beep
MsgBox "The password you entered is not valid.", _
vbOKOnly + vbExclamation, "Invalid Password"
Case ecCantFindObject
intErrorType = intcCantFindTable
GoTo fChangeLinkFailure
Case Else
intErrorType = intcOtherError
GoTo fChangeLinkFailure
End Select
DoCmd.Close acForm, strcPasswordForm
DoCmd.OpenForm strcPasswordForm, , , , , acDialog, _
strFileName(strNewLink)
Loop
Case ecCantFindObject
intErrorType = intcCantFindTable
GoTo fChangeLinkFailure
Case Else
intErrorType = intcOtherError
GoTo fChangeLinkFailure
End Select
End If

fChangeLinkFailure:
fChangeLink = False
mtbl.Connect = strOldConnect
If mfLinkFromUser Then
Select Case intErrorType
Case intcCantFindTable
Beep
MsgBox "Can not find table """ & mtbl.SourceTableName _
& """ in this database.", , "Change Link Error"
Case intcOtherError
Beep
MsgBox "Can not link to table """ & mtbl.SourceTableName _
& """ in database """ & strNewLink & """.@@" _
& Err.Description, , "Change Link Error " & Err.Number
Case Else
End Select
End If
GoTo fChangeLink_End

fChangeLinkSuccess:
fChangeLink = True
CacheLink strOldLink, strNewLink
LogResult "...Link Fixed " & "[NOW " & strNewLink & "]"

fChangeLink_End:
DoCmd.Close acForm, strcPasswordForm
On Error GoTo 0

End Function

Private Sub CacheLink(ByVal strOldLink As String, ByVal strNewLink As String)

On Error GoTo CacheLink_Err
Dim I As Integer

For I = 0 To UBound(mastrOldLinks)
If mastrOldLinks(I) = strOldLink Then
mastrNewLinks(I) = strNewLink
Exit Sub
ElseIf mastrOldLinks(I) = "" Then
Exit For
End If
Next

If I > UBound(mastrOldLinks) Then
ReDim Preserve mastrOldLinks(I)
ReDim Preserve mastrNewLinks(I)
End If
mastrOldLinks(I) = strOldLink
mastrNewLinks(I) = strNewLink

CacheLink_End:
On Error GoTo 0
Exit Sub

CacheLink_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in sub basTableLinks.CacheLink"
Resume CacheLink_End

End Sub

Private Function fLinkIsFile() As Boolean

On Error GoTo fLinkIsFile_Err
Dim strConnect As String
Dim I As Integer

strConnect = mtbl.Connect

If Left$(strConnect, 10) = ";Database=" Then
fLinkIsFile = True
ElseIf Left$(strConnect, 5) = "Excel" Then
fLinkIsFile = True
ElseIf Left$(strConnect, 4) = "HTML" Then
fLinkIsFile = True
ElseIf Left$(strConnect, 4) = "Text" Then
fLinkIsFile = False
ElseIf Left$(strConnect, 4) = "dBase" Then
fLinkIsFile = False
ElseIf Left$(strConnect, 7) = "Paradox" Then
fLinkIsFile = False
Else
For I = Len(strConnect) To 1 Step -1
If Mid$(strConnect, I, 1) = "." Then
fLinkIsFile = True
Exit For
ElseIf Mid$(strConnect, I, 1) = "\" Then
fLinkIsFile = False
Exit For
End If
Next
End If

fLinkIsFile_End:
On Error GoTo 0
Exit Function

fLinkIsFile_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.fLinkIsFile"
Resume fLinkIsFile_End

End Function

Private Sub SetRunOnce(ByRef rvarSetting As Boolean)

On Error GoTo SetRunOnce_Err
Dim prp As Property

mdb.Properties(mstrcRunOncePropertyName) = rvarSetting
mdb.Properties.Refresh

SetRunOnce_End:
On Error GoTo 0
Exit Sub

SetRunOnce_Err:
Select Case Err.Number
Case ecPropNotFound
Set prp = mdb.CreateProperty(mstrcRunOncePropertyName, _
dbBoolean, rvarSetting)
mdb.Properties.Append prp
mdb.Properties.Refresh
Set prp = Nothing
Resume SetRunOnce_End
Case Else
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.Set_tsTableLinkerRunOnce"
Resume SetRunOnce_End
End Select

End Sub

Private Function fGetRunOnce() As Boolean

On Error Resume Next
fGetRunOnce = mdb.Properties(mstrcRunOncePropertyName)
If Err <> 0 Then fGetRunOnce = False
On Error GoTo 0

End Function

Private Sub LogProcess(ByRef rstrMsg As String)

If mfDebug Then Debug.Print rstrMsg;
If mstrLogFile <> "" Then mstrLog = mstrLog & rstrMsg

End Sub

Private Sub LogResult(ByRef rstrMsg As String)

If mfDebug Then Debug.Print rstrMsg
If mstrLogFile <> "" Then mstrLog = mstrLog & rstrMsg & vbCrLf

End Sub

Private Sub WriteLogFile()

On Error GoTo WriteLogFile_Err
Dim intFile As Integer

If mstrLogFile <> "" Then
intFile = FreeFile
Open mstrLogFile For Output As intFile
Print #intFile, mstrLog
End If

WriteLogFile_End:
On Error Resume Next
Close #intFile
On Error GoTo 0
Exit Sub

WriteLogFile_Err:
Resume WriteLogFile_End

End Sub

Public Sub tsDumpLinks(Optional fShowFullConnectStrings As Boolean = True)

On Error GoTo tsDumpLinks_Err

Set mdb = CurrentDb

Debug.Print
Debug.Print "LINKED TABLES:"
Debug.Print "----------------------------------"
Debug.Print "LocalName SourceTableName LinkStatus"
If fShowFullConnectStrings Then
Debug.Print "Full Connect String"
Else
Debug.Print "Link"
End If
Debug.Print "----------------------------------"
Debug.Print
For Each mtbl In CurrentDb.TableDefs
If InStr(mtbl.Connect, ";DATABASE=") <> 0 Then
Debug.Print mtbl.Name; Tab(21); mtbl.SourceTableName; Tab(41); _
IIf(fLinkIsValid(mtbl.Name), "[OK]", "[MISSING]")
If fShowFullConnectStrings Then
Debug.Print mtbl.Connect
Else
Debug.Print tsstrGetItem("DATABASE", mtbl.Connect)
End If
Debug.Print
End If
Next

tsDumpLinks_End:
On Error Resume Next
Set mdb = Nothing
On Error GoTo 0
Exit Sub

tsDumpLinks_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in sub basTableLinks.tsDumpLinks"
Resume tsDumpLinks_End

End Sub
 
Eek!! Part 3!!!

PHP:
Private Function strGetPathFromCache() As String

On Error GoTo strGetPathFromCache_Err
Dim strPath As String
Dim I As Integer
Dim intFileStart As Integer

If Not fLinkIsFile() Then GoTo strGetPathFromCache_End

strPath = Mid$(mtbl.Connect, InStr(mtbl.Connect, ";DATABASE=") + 10)
intFileStart = intFindFileStart(strPath)
If intFileStart = 0 Then GoTo strGetPathFromCache_End _
Else strPath = Left$(strPath, intFileStart - 1)

For I = 0 To UBound(mastrOldLinks)
If mastrOldLinks(I) = "" Then Exit For
intFileStart = intFindFileStart(mastrOldLinks(I))
If intFileStart <> 0 Then
If strPath = Left$(mastrOldLinks(I), intFileStart - 1) Then
intFileStart = intFindFileStart(mastrNewLinks(I))
If intFileStart <> 0 Then
strGetPathFromCache = Left$(mastrNewLinks(I), intFileStart - 1)
Exit For
End If
End If
End If
Next

strGetPathFromCache_End:
On Error GoTo 0
Exit Function

strGetPathFromCache_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.strGetPathFromCache"
Resume strGetPathFromCache_End

End Function

Private Function strFileName(Optional ByVal strPath As String = "") As String

On Error GoTo strFileName_Err
Dim intFileStart As Integer
Dim strLink As String
Dim T As Integer

If strPath <> "" Then
For T = Len(strPath) - 1 To 1 Step -1
If Mid$(strPath, T, 1) = "\" Then Exit For
Next
strFileName = Mid$(strPath, T + 1)
GoTo strFileName_End
End If

If fLinkIsFile() Then
strLink = Mid$(mtbl.Connect, InStr(mtbl.Connect, ";DATABASE=") + 10)
intFileStart = intFindFileStart(strLink)
If intFileStart <> 0 Then
strFileName = Mid$(strLink, intFileStart)
End If
End If

strFileName_End:
On Error GoTo 0
Exit Function

strFileName_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.strFileName"
Resume strFileName_End


End Function

Private Function intFindFileStart(ByRef rstrFullPath) As Integer

On Error GoTo intFindFileStart_Err
Dim I As Integer

For I = Len(rstrFullPath) To 1 Step -1
If Mid$(rstrFullPath, I, 1) = "\" Then
intFindFileStart = I + 1
GoTo intFindFileStart_End
End If
Next

intFindFileStart_End:
On Error GoTo 0
Exit Function

intFindFileStart_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in function basTableLinks.intFindFileStart"
Resume intFindFileStart_End

End Function

CALL IT IN THE ONLOAD EVENT OF THE STARTUPFORM

=tsCheckTableLinks()
 

Users who are viewing this thread

Back
Top Bottom