Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference.IsBroken - errors

Status
Not open for further replies.

Parax

Technical User
Jan 29, 2003
41
GB
I have a frontend A97 database that is automatically distributed to users pc's there is a refernce to a DLL that is only installed on some machines. to avoid putting the DLL onto all the machines I tried to un-reference it when it is not present. But all I get is an error:

runtime error '48' - Error in loading DLL

This is generated by ref.IsBroken - I need the isbroken to return true but it does not!!

Code:

Sub CheckReferences()
Dim ref As Reference
For Each ref In References
If ref.IsBroken Then
References.Remove ref
End If
Next ref
End Sub

Any comments suggestions appreciated..

Mike
 
You problem is that the dll that is missing is the one that contains the information about .IsBroken - so inorder to run the IsBroken command you need the dll that you can't find - stuck between a rock and a hard place!


Might I suggest that the solution is simply to copy the dll along with the application when you distribute it. ( & put it into the relevant folder, of course )



'ope-that-'elps.




G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
LittleSmudge,
Thanx for the feedback,
however the dll does not contain .isbroken the DLL in question is a bespoke credit card processing DLL and is not one of the core acces/vba DLL's. I guess trapping for error 48 is the best option, however I was hoping to shed some light on why the function does not return true. (I am tesing this by renaming the registered DLL file not by unregistering it - could this be an issue?)
 
Quite probobly.

You have now slammed into the dark and mysterious world of the Windows Registry. I recall having severe problem distributing an Access 2000 application around to ~100 machines becuase a few of them had a slightly different set up and had different versions of the DLLs available. Even copying the ( known correct ) DLLs onto the problem machines did not help. I was told by the site Teck Support that this was because the old versions were apparently accessed via the Registry which I had no ability to control - and NO they won't give me access to the Registry ( SysAdmin rights ) so that I could fix the problem.


However, if your offending DLL isn't the one then

Maybe it's because:-

I use

For Each ref In Application.References

in my version. Could that be your problem ?






G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
This is the solution Im going to have to use, seems to work ok, so it will do:

Sub CheckReferences()
On Error GoTo ErrHandler:
Dim Ref As Reference

For Each Ref In Application.References
If Ref.IsBroken Then GoTo RemoveRef:
Next Ref
Exit Sub

RemoveRef:
References.Remove Ref
MsgBox "Missing........", vbOKOnly
Resume Next

ErrHandler:
If Err.Number = 48 Then GoTo RemoveRef:

End Sub


Thanx for the feedback

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top