Hmmm, tricky. Here's a couple of thoughts...

Your standard exe test didn't set a reference to the dll, but just included
it in the project group. It raised an error, but perhaps not the one you're
expecting. I'm pretty sure you still have to set a project reference to the
GlobalMultiUse dll in any project that wants those functions to appear in
the project namespace. My guess is the error you're getting is because "Fetch"
can't be resolved in the first place, not because it's returning an error.

Your ActiveX exe included a reference to the dll (which I think you have
to do), but didn't raise an error. Are you sure Fetch raises an error? Or
does it trap and handle the error internally? You have to raise an error
(e.g., err.raise 1) in the error handler to pass the error up to the calling

More generally, GlobalMultiUse dll's aren't popular because there's a performance
penalty associated with them and they really only are for programmer convenience.
They can also lead to "namespace pollution" and you run the risk of namespace
conflicts with generically named methods such as "fetch".

The following code has higher performance:

Dim obj as MyDll
Dim rst as ADODB.Recordset
Set obj = New MyDll
Set rst = MyDll.Fetch("aaaaaa", adOpenForwardOnly, _

The GlobalMultiUse, performance-wise, is equivalent to the slower code:

Dim obj as New MyDLL
Dim rst as ADODB.Recordset
Set rst = MyDll.Fetch("aaaaaa", adOpenForwardOnly, _

Tom Shreve

"Antonio Paglia" <> wrote:
> Dim rst As ADODB.Recordset
> Set rst = Fetch("aaaaaa", adOpenForwardOnly, adLockReadOnly)
> If Err.Number <> 0 Then
> MsgBox "Error ...."
> End If
>Fetch: is a method of a class (GlobalMultiuse) in DLL components. The first
>argument must be a valid SQL statement. If an error occurs, fetch raise

>error to the client (with err.raise )
>I call this function from a project (EXE ActiveX) that reference that DLL
>Result: The error is not returned back to the client. Err.number = 0
>I create a Test project(EXE Standard) that include a single form. I place
>the above statements in the Form_Load() event.
>But the test project does not reference directly the DLL file. I include

>DLL project in this test group project.
>Result: The error is returned back to the client