I've decide just to release the mdb file rather than a MDE file. It's
to hard to get the MDE to work.
Does any one know why the MDB works and MDE does not? What I mean is,
why can the MDB find the references while th MDE can not. I would
think they work the same way.
The difference is though that MDBs can continue to work until you hit
lines of code that use the DLLs which couldn't be found. Whereas an
MDE requires that all your references be intact and working before
it'll even start executing any code.
Well sorta.
Subject: INFO: How to guarantee that references will work in your
applications.
http://www.trigeminal.com/usenet/usenet026.asp?1033
I also use some code which checks that all my references are intact,
cleans up a few if I've just converted the app from A97 to A2002 or
newer, and displays the troublesome references.
Subject: INFO: How to guarantee that references will work in your
applications.
http://www.trigeminal.com/usenet/usenet026.asp?1033
Function tt_FixReferences() As Boolean
' This function can't reside in tt_utils.mdb/mde as it is used to fix
any reference problems
' Including when converting from A97 to A2000 and A2002.
Dim ref As Reference
Dim stMsg As String, intPosn As Integer, strRefPathName As String,
blnCompile As Boolean
On Error GoTo tagError
For Each ref In Access.References
If ref.IsBroken Then
VBA.MsgBox "Ref" & ref.Name & " is broken."
Else
' Debug.Print ref.Name & ", " & ref.FullPath
Select Case Access.SysCmd(acSysCmdAccessVer)
Case 9# ' Access 2000
If ref.Name = "VBIDE" Then
strRefPathName = ref.FullPath
References.Remove ref
VBA.MsgBox strRefPathName & " removed."
blnCompile = True
End If
Case 10# ' Access 2002
If ref.Name = "VBIDE" Or ref.Name = "OWC10" Then
strRefPathName = ref.FullPath
References.Remove ref
VBA.MsgBox strRefPathName & " removed."
blnCompile = True
End If
End Select
End If
Next ref
tt_FixReferences = True
If blnCompile = True Then
Call Access.SysCmd(504, 16483)
MsgBox "Compiled."
End If
tagExit:
Exit Function
tagError:
If Err = 48 Then ' ?????
If VBA.Len(VBA.Dir(ref.FullPath)) > 0 Then
References.AddFromGuid ref.Guid, ref.Major, ref.Minor
Resume Next
Else
stMsg = "Reference " & vbCrLf & "'" & ref.FullPath & "'" _
& vbCrLf & "couldn't be restored."
VBA.MsgBox stMsg, vbCritical + vbOKOnly, _
"Error restoring references."
tt_FixReferences = False
Resume tagExit
End If
Else
stMsg = "An unexpected error occurred." _
& vbCrLf & "Number: " & Err.Number _
& vbCrLf & "Description: " & Err.Description
VBA.MsgBox stMsg, vbCritical + vbOKOnly, _
"Error restoring references."
tt_FixReferences = False
Resume tagExit
End If
End Function
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm