Re: Err.Raise in COM+ Component loses Err.Source and Err.Description
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Apr 2006 11:38:19 +0100
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:<primarykeyfieldname
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
here> = " & PrimaryKeyworked
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
for a long time.have
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
many Windows XP Professional clients and they work fine. There is,however,
one Windows 2000 Professional client that, no matter what I've tried, getsthe
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
proper range (vbObjectError + 3604 where 3604 is the ADO error number).
Is there something in Windows 2000 that prevents remote error information?
.
- Follow-Ups:
- References:
- Prev by Date: Re: Worth checking out - J French
- Next by Date: Re: How to write a diff in VB6 for comparing two xml files?
- Previous by thread: Err.Raise in COM+ Component loses Err.Source and Err.Description
- Next by thread: Re: Err.Raise in COM+ Component loses Err.Source and Err.Description
- Index(es):
Relevant Pages
|