If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Component does not raise the error to the client....

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
routine.

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".

"Antonio Paglia" <apaglia@impsat1.com.ar> 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
the
>error to the client (with err.raise )
>
>TEST N.1
>I call this function from a project (EXE ActiveX) that reference that DLL
>file.
>Result: The error is not returned back to the client. Err.number = 0
>
>TEST N.2
>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
the
>DLL project in this test group project.
>Result: The error is returned back to the client