Cannot find external name error

We have a custom “GetDocByKey” function in a script library that is called from a WQO agent.

Every now and again, we get “Cannot find external name”

We recompiled the database on the server but are still getting the error intermittently

Can anyone give any suggestions for a solution?

Apologies for the second post of this within 8 days - we are at our wits end to get this error sorted. It seems to occur two or three times a at at least (with no real pattern)

TIA

Mike