Re: Err.Raise in COM+ Component loses Err.Source and Err.Description

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Try moving your code that captures the Err details to before the 'Set cnDBMS
= Nothing' Rich. e.g.

MTSError:
Dim lNum As Long, sSrc As String, sDescr As String
lNum = Err.Number: sSrc = Err.Source: sDescr = Err.Description
Set cnDBMS = Nothing
GetObjectContext.SetAbort
Err.Raise lNum, sSrc, sDescr
End Sub

It may be code that's being executed during the destruction of the cnDBMS
object that's affecting the global Err object

Tony Proctor

"Rich M" <rmabry-nospam@xxxxxxxxxxxx> wrote in message
news:#wPMetaXGHA.508@xxxxxxxxxxxxxxxxxxxxxxx
In a COM+ comopnent, we have code which does the following:

Public Sub Delete(ByVal PrimaryKey as Long, ByVal ConnectionString as
String)

Dim cnDBMS As Connection

Set cnDBMS = New Connection
cnDBMS.Open ConnectionString

cnDBMS.Execute "DELETE FROM <tablename here> WHERE
<primarykeyfieldname
here> = " & PrimaryKey

GetObjectContext.SetComplete

Set cnDBMS = Nothing

Exit Sub

MTSError:
Set cnDBMS = Nothing
GetObjectContext.SetAbort
Err.Raise Err.Number, Err.Source, Err.Description

End Sub

On the client side, we create an object which creates a remote instance of
the COM+ class and calls the Delete method. If the Delete fails for some
reason (like a foreign key usage issue), an error is raised and we trap it
and report to the user the table where the record is used. This has
worked
for a long time.

Now, though, we have issues with the COM+ components on a Windows 2003
Server and *some* clients. On our own network, we have a Windows 2003
Server client that we use via Terminal Services and it works fine. We
have
many Windows XP Professional clients and they work fine. There is,
however,
one Windows 2000 Professional client that, no matter what I've tried, gets
the Err.Number in the client-side DLL, but the Err.Source is blank and
Err.Description is simply "Automation Error".

I've tried storing the Err info before the SetAbort and re-raising it
afteward - didn't work.
I've tried changing the Err.Number to something else even though it's in
the
proper range (vbObjectError + 3604 where 3604 is the ADO error number).

Is there something in Windows 2000 that prevents remote error information?






.



Relevant Pages

  • Err.Raise in COM+ Component loses Err.Source and Err.Description
    ... Public Sub Delete(ByVal PrimaryKey as Long, ByVal ConnectionString as ... Set cnDBMS = New Connection ... Now, though, we have issues with the COM+ components on a Windows 2003 ... Server client that we use via Terminal Services and it works fine. ...
    (microsoft.public.vb.general.discussion)
  • Re: Err.Raise in COM+ Component loses Err.Source and Err.Description
    ... Public Sub Delete(ByVal PrimaryKey as Long, ByVal ConnectionString as ... Set cnDBMS = New Connection ... Now, though, we have issues with the COM+ components on a Windows 2003 ... Server client that we use via Terminal Services and it works fine. ...
    (microsoft.public.vb.general.discussion)
  • Re: Err.Raise in COM+ Component loses Err.Source and Err.Description
    ... The "Set cnDBMS = Nothing" line is actually something I added trying to get ... Public Sub Delete(ByVal PrimaryKey as Long, ByVal ConnectionString as ... On the client side, we create an object which creates a remote instance ... Now, though, we have issues with the COM+ components on a Windows 2003 ...
    (microsoft.public.vb.general.discussion)