Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Error object in PB

7 posts in Objects Last posting was on 2005-05-26 05:30:29.0Z
Juan Posted on 2005-05-24 18:09:48.0Z
From: "Juan" <juan@aol.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Error object in PB
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Original-NNTP-Posting-Host: 65.37.79.132
Message-ID: <42936de6$1@forums-2-dub>
X-Original-Trace: 24 May 2005 11:09:42 -0700, 65.37.79.132
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 May 2005 11:09:45 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 May 2005 11:09:48 -0700
X-Trace: forums-1-dub 1116958188 10.22.108.75 (24 May 2005 11:09:48 -0700)
X-Original-Trace: 24 May 2005 11:09:48 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8410
Article PK: 735637

Hi everybody, I am trying to port VB code to PB and I runned into the Err
structure in VB. How can I port the following code?:

Dim qInfo As MSMQ.MSMQQueueInfo

On Error GoTo ErrHandler
Set qInfo = New MSMQ.MSMQQueueInfo

qInfo.Create

ErrHandler:
If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
'Queue already exists
Resume Next
End If

I know there is an Error object in PB, but the error.number value it's a
specific PB error number. If I use GetLastError() API, it comes back with 0.
I need to find the equivalent (if any) of Err.Number value in PB.


Juan Posted on 2005-05-24 18:14:44.0Z
Sender: 3e68.42936ee4.1804289383@sybase.com
From: Juan
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Error object in PB
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42936f14.3e6d.1681692777@sybase.com>
References: <42936de6$1@forums-2-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 24 May 2005 11:14:44 -0700
X-Trace: forums-1-dub 1116958484 10.22.241.41 (24 May 2005 11:14:44 -0700)
X-Original-Trace: 24 May 2005 11:14:44 -0700, 10.22.241.41
Lines: 25
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8411
Article PK: 735633

I forgot to say thanks for your help!

> Hi everybody, I am trying to port VB code to PB and I
> runned into the Err structure in VB. How can I port the
> following code?:
>
> Dim qInfo As MSMQ.MSMQQueueInfo
>
> On Error GoTo ErrHandler
> Set qInfo = New MSMQ.MSMQQueueInfo
>
> qInfo.Create
>
> ErrHandler:
> If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
> 'Queue already exists
> Resume Next
> End If
>
> I know there is an Error object in PB, but the
> error.number value it's a specific PB error number. If I
> use GetLastError() API, it comes back with 0. I need to
> find the equivalent (if any) of Err.Number value in PB.
>
>


Bruce Armstrong [TeamSybase] Posted on 2005-05-25 01:58:02.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Error object in PB
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <prm791pc9govq6bh83bmjlcbd22nt2kecp@4ax.com>
References: <42936de6$1@forums-2-dub> <42936f14.3e6d.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-Trace: 24 May 2005 18:57:58 -0700, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 82
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 May 2005 18:57:59 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 May 2005 18:58:02 -0700
X-Trace: forums-1-dub 1116986282 10.22.108.75 (24 May 2005 18:58:02 -0700)
X-Original-Trace: 24 May 2005 18:58:02 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8412
Article PK: 735635

Just so you know, when you respond to your own message, you give
people who are scanning for messages to answer the impression that
it's already been answered. It actually significantly reduces the
chances of getting an answer.

On 24 May 2005 11:14:44 -0700, Juan wrote:

>I forgot to say thanks for your help!
>
>> Hi everybody, I am trying to port VB code to PB and I
>> runned into the Err structure in VB. How can I port the
>> following code?:
>>
>> Dim qInfo As MSMQ.MSMQQueueInfo
>>
>> On Error GoTo ErrHandler
>> Set qInfo = New MSMQ.MSMQQueueInfo
>>
>> qInfo.Create
>>
>> ErrHandler:
>> If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
>> 'Queue already exists
>> Resume Next
>> End If
>>
>> I know there is an Error object in PB, but the
>> error.number value it's a specific PB error number. If I
>> use GetLastError() API, it comes back with 0. I need to
>> find the equivalent (if any) of Err.Number value in PB.
>>
>>

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

June ISUG Techcast: PowerBuilder .NET Compiler In-Depth Review - June
7 & 9, 1:00 pm EDT
http://response.sybase.com/forms/JunISUGReg

TeamSybase blogs:
http://www.teamsybase.net/blogs

PowerBuilder Developer's Journal:
http://sys-con.com/pbdj/

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
NOTE:

If you are using Google to post messages to the newsgroups, you will
*not* receive a reply. Messages posted through Google never reach the
Sybase newsgroup server, so we don't see them in order to respond to
them. You should post your question using a standard newsgroup reader
or the web based newsreaders at my.sybase.com or www.pfcguide.com.
Google is great for searching the Sybase newsgroups, but you can't post
to them from there.

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.


Bruce Armstrong [TeamSybase] Posted on 2005-05-25 02:04:37.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Error object in PB
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <etm7915lmpke1jgtd11gliusfjlqfluncp@4ax.com>
References: <42936de6$1@forums-2-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-Trace: 24 May 2005 19:04:33 -0700, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 117
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 May 2005 19:04:34 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 May 2005 19:04:37 -0700
X-Trace: forums-1-dub 1116986677 10.22.108.75 (24 May 2005 19:04:37 -0700)
X-Original-Trace: 24 May 2005 19:04:37 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8413
Article PK: 735634

Warning: I have not attempted to use the following, I'm just
converting on the fly:

>Dim qInfo As MSMQ.MSMQQueueInfo
oleobject ole_msmq
ole_msmq = CREATE oleobject

>
>On Error GoTo ErrHandler

try

>Set qInfo = New MSMQ.MSMQQueueInfo
ole_msmq.ConnectToNewObject ( "MSMSQueueInfo" )

>qInfo.Create

I have no idea, because there's no reference to qInfo in your snippet
of code.

>ErrHandler:

catch ( OLERuntimeError e )

>If Err.Number = MQ_ERROR_QUEUE_EXISTS Then

IF e.Number = (some constant you're going to have to define manually )
THEN

> 'Queue already exists

Just a comment

> Resume Next

Nothing really. What you want to do is raise an error message if it
wasn't this error.

>End If

END IF

The only caveat is that you might not get an exception, you may get a
negative return value from the ConnectToNewObject call.


On 24 May 2005 11:09:48 -0700, "Juan" <juan@aol.com> wrote:

>Hi everybody, I am trying to port VB code to PB and I runned into the Err
>structure in VB. How can I port the following code?:
>
>Dim qInfo As MSMQ.MSMQQueueInfo
>
>On Error GoTo ErrHandler
>Set qInfo = New MSMQ.MSMQQueueInfo
>
>qInfo.Create
>
>ErrHandler:
>If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
> 'Queue already exists
> Resume Next
>End If
>
>I know there is an Error object in PB, but the error.number value it's a
>specific PB error number. If I use GetLastError() API, it comes back with 0.
>I need to find the equivalent (if any) of Err.Number value in PB.
>

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

June ISUG Techcast: PowerBuilder .NET Compiler In-Depth Review - June
7 & 9, 1:00 pm EDT
http://response.sybase.com/forms/JunISUGReg

TeamSybase blogs:
http://www.teamsybase.net/blogs

PowerBuilder Developer's Journal:
http://sys-con.com/pbdj/

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
NOTE:

If you are using Google to post messages to the newsgroups, you will
*not* receive a reply. Messages posted through Google never reach the
Sybase newsgroup server, so we don't see them in order to respond to
them. You should post your question using a standard newsgroup reader
or the web based newsreaders at my.sybase.com or www.pfcguide.com.
Google is great for searching the Sybase newsgroups, but you can't post
to them from there.

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.


Bruce Armstrong [TeamSybase] Posted on 2005-05-25 02:13:14.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Error object in PB
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <bgn791d8a2rvtsni2b7n9ct8q7h9fgb81h@4ax.com>
References: <42936de6$1@forums-2-dub> <etm7915lmpke1jgtd11gliusfjlqfluncp@4ax.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-Trace: 24 May 2005 19:13:09 -0700, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 180
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 May 2005 19:13:10 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 May 2005 19:13:14 -0700
X-Trace: forums-1-dub 1116987194 10.22.108.75 (24 May 2005 19:13:14 -0700)
X-Original-Trace: 24 May 2005 19:13:14 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8414
Article PK: 735636

Doh! Let me try this one again:

>Set qInfo = New MSMQ.MSMQQueueInfo
ole_msmq.ConnectToNewObject ( "MSMQ.MSMQQueueInfo" ) <= typo

>qInfo.Create

ole_msmq.Create() <= brain fade


On 24 May 2005 19:04:37 -0700, "Bruce Armstrong [TeamSybase]"

<NOCANSPAM_bruce.armstrong@teamsybase.com> wrote:

>Warning: I have not attempted to use the following, I'm just
>converting on the fly:
>
>>Dim qInfo As MSMQ.MSMQQueueInfo
>oleobject ole_msmq
>ole_msmq = CREATE oleobject
>
>>
>>On Error GoTo ErrHandler
>try
>
>>Set qInfo = New MSMQ.MSMQQueueInfo
> ole_msmq.ConnectToNewObject ( "MSMSQueueInfo" )
>
>>qInfo.Create
>
>I have no idea, because there's no reference to qInfo in your snippet
>of code.
>
>>ErrHandler:
>
>catch ( OLERuntimeError e )
>
>>If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
>
>IF e.Number = (some constant you're going to have to define manually )
>THEN
>
>> 'Queue already exists
>
>Just a comment
>
>> Resume Next
>
>Nothing really. What you want to do is raise an error message if it
>wasn't this error.
>
>>End If
>
>END IF
>
>The only caveat is that you might not get an exception, you may get a
>negative return value from the ConnectToNewObject call.
>
>
>On 24 May 2005 11:09:48 -0700, "Juan" <juan@aol.com> wrote:
>
>>Hi everybody, I am trying to port VB code to PB and I runned into the Err
>>structure in VB. How can I port the following code?:
>>
>>Dim qInfo As MSMQ.MSMQQueueInfo
>>
>>On Error GoTo ErrHandler
>>Set qInfo = New MSMQ.MSMQQueueInfo
>>
>>qInfo.Create
>>
>>ErrHandler:
>>If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
>> 'Queue already exists
>> Resume Next
>>End If
>>
>>I know there is an Error object in PB, but the error.number value it's a
>>specific PB error number. If I use GetLastError() API, it comes back with 0.
>>I need to find the equivalent (if any) of Err.Number value in PB.
>>
>
>Bruce Armstrong [TeamSybase]
>http://www.teamsybase.com
>
>June ISUG Techcast: PowerBuilder .NET Compiler In-Depth Review - June
>7 & 9, 1:00 pm EDT
>http://response.sybase.com/forms/JunISUGReg
>
>TeamSybase blogs:
>http://www.teamsybase.net/blogs
>
>PowerBuilder Developer's Journal:
>http://sys-con.com/pbdj/
>
>Two 3rd party books on developing with PowerBuilder
>http://www.pb9books.com?source=newsgroups
>
>Need code sample? Check out CodeXchange:
>http://www.codexchange.sybase.com
>
>Preach the gospel at all times. If necessary, use words. - Francis of Assisi
>http://www.needhim.org
>
>---------------------------------------------------------------------
>NOTE:
>
>If you are using Google to post messages to the newsgroups, you will
>*not* receive a reply. Messages posted through Google never reach the
>Sybase newsgroup server, so we don't see them in order to respond to
>them. You should post your question using a standard newsgroup reader
>or the web based newsreaders at my.sybase.com or www.pfcguide.com.
>Google is great for searching the Sybase newsgroups, but you can't post
>to them from there.
>
>---------------------------------------------------------------------
>DISCLAIMER:
>
>This newsgroup message is only intended for the recipient. Given that it
>is a posting to a public newsgroup, that means if you can read this
>message then you are the recipient. This message may contain information
>that is confidential and protected from disclosure. And then again,
>it may not.
>
>Given that TeamSybase members are not employees of Sybase, the contents
>of this message do not necessarily represent the views or policies of
>Sybase. Given that TeamSybase is a diverse group of users of Sybase
>products, the contents of this message do not necessarily represent the
>views of a significant number of the members of TeamSybase. Given that the
>author has multiple personalities and hears voices in his head, the contents
>of this message do not necessarily represent his own views.

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

June ISUG Techcast: PowerBuilder .NET Compiler In-Depth Review - June
7 & 9, 1:00 pm EDT
http://response.sybase.com/forms/JunISUGReg

TeamSybase blogs:
http://www.teamsybase.net/blogs

PowerBuilder Developer's Journal:
http://sys-con.com/pbdj/

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
NOTE:

If you are using Google to post messages to the newsgroups, you will
*not* receive a reply. Messages posted through Google never reach the
Sybase newsgroup server, so we don't see them in order to respond to
them. You should post your question using a standard newsgroup reader
or the web based newsreaders at my.sybase.com or www.pfcguide.com.
Google is great for searching the Sybase newsgroups, but you can't post
to them from there.

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.


Juan Posted on 2005-05-25 13:11:21.0Z
Sender: 715c.42947787.1804289383@sybase.com
From: jUAN
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Error object in PB
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42947975.716f.1681692777@sybase.com>
References: <etm7915lmpke1jgtd11gliusfjlqfluncp@4ax.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 25 May 2005 06:11:17 -0700, 10.22.241.42
Lines: 137
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 May 2005 06:11:18 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 May 2005 06:11:21 -0700
X-Trace: forums-1-dub 1117026681 10.22.108.75 (25 May 2005 06:11:21 -0700)
X-Original-Trace: 25 May 2005 06:11:21 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8416
Article PK: 735643

Thanks for the feedback Bruce. I actually tried doing
"try...catch" and traping the exception error number, but I
still get a PB error number, not Microsoft's defined error.
I can't use your other approach ( ole_obj.Create() <= 0 )
because if I get an error, I get a runtime error.

FYI:
MQ_ERROR_QUEUE_EXISTS = 3222142981 and when I get the
error, PB returns 35. I am also pretty sure this is the
value I should be getting back, the VB code reports this
error, I should expect the same on PB, if I could get my
hands on the error number.

> Warning: I have not attempted to use the following, I'm
> just converting on the fly:
>
> >Dim qInfo As MSMQ.MSMQQueueInfo
> oleobject ole_msmq
> ole_msmq = CREATE oleobject
>
> >
> >On Error GoTo ErrHandler
> try
>
> >Set qInfo = New MSMQ.MSMQQueueInfo
> ole_msmq.ConnectToNewObject ( "MSMSQueueInfo" )
>
> >qInfo.Create
>
> I have no idea, because there's no reference to qInfo in
> your snippet of code.
>
> >ErrHandler:
>
> catch ( OLERuntimeError e )
>
> >If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
>
> IF e.Number = (some constant you're going to have to
> define manually ) THEN
>
> > 'Queue already exists
>
> Just a comment
>
> > Resume Next
>
> Nothing really. What you want to do is raise an error
> message if it wasn't this error.
>
> >End If
>
> END IF
>
> The only caveat is that you might not get an exception,
> you may get a negative return value from the
> ConnectToNewObject call.
>
>
> On 24 May 2005 11:09:48 -0700, "Juan" <juan@aol.com>
> wrote:
>
> >Hi everybody, I am trying to port VB code to PB and I
> runned into the Err >structure in VB. How can I port the
> following code?: >
> >Dim qInfo As MSMQ.MSMQQueueInfo
> >
> >On Error GoTo ErrHandler
> >Set qInfo = New MSMQ.MSMQQueueInfo
> >
> >qInfo.Create
> >
> >ErrHandler:
> >If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
> > 'Queue already exists
> > Resume Next
> >End If
> >
> >I know there is an Error object in PB, but the
> error.number value it's a >specific PB error number. If I
> use GetLastError() API, it comes back with 0. >I need to
> find the equivalent (if any) of Err.Number value in PB. >
>
> Bruce Armstrong [TeamSybase]
> http://www.teamsybase.com
>
> June ISUG Techcast: PowerBuilder .NET Compiler In-Depth
> Review - June 7 & 9, 1:00 pm EDT
> http://response.sybase.com/forms/JunISUGReg
>
> TeamSybase blogs:
> http://www.teamsybase.net/blogs
>
> PowerBuilder Developer's Journal:
> http://sys-con.com/pbdj/
>
> Two 3rd party books on developing with PowerBuilder
> http://www.pb9books.com?source=newsgroups
>
> Need code sample? Check out CodeXchange:
> http://www.codexchange.sybase.com
>
> Preach the gospel at all times. If necessary, use words. -
> Francis of Assisi http://www.needhim.org
>
> ----------------------------------------------------------
> ----------- NOTE:
>
> If you are using Google to post messages to the newsgroups
> , you will *not* receive a reply. Messages posted through
> Google never reach the Sybase newsgroup server, so we
> don't see them in order to respond to them. You should
> post your question using a standard newsgroup reader or
> the web based newsreaders at my.sybase.com or
> www.pfcguide.com. Google is great for searching the
> Sybase newsgroups, but you can't post to them from there.
>
> ----------------------------------------------------------
> ----------- DISCLAIMER:
>
> This newsgroup message is only intended for the recipient.
> Given that it is a posting to a public newsgroup, that
> means if you can read this message then you are the
> recipient. This message may contain information that is
> confidential and protected from disclosure. And then again
> , it may not.
>
> Given that TeamSybase members are not employees of Sybase,
> the contents of this message do not necessarily represent
> the views or policies of Sybase. Given that TeamSybase
> is a diverse group of users of Sybase products, the
> contents of this message do not necessarily represent the
> views of a significant number of the members of
> TeamSybase. Given that the author has multiple
> personalities and hears voices in his head, the contents
> of this message do not necessarily represent his own
> views.


Bruce Armstrong [TeamSybase] Posted on 2005-05-26 05:30:29.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Error object in PB
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <nlna91prvdoumrt74irj1mg9h1tfrkm05u@4ax.com>
References: <etm7915lmpke1jgtd11gliusfjlqfluncp@4ax.com> <42947975.716f.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
Date: 25 May 2005 22:30:29 -0700
X-Trace: forums-1-dub 1117085429 68.190.226.38 (25 May 2005 22:30:29 -0700)
X-Original-Trace: 25 May 2005 22:30:29 -0700, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 193
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8417
Article PK: 735639

The test I was referring to was the return from the ConnectToNewObject
call (which I wasn't even trapping). You need to make sure that works
before trying to invoke the Create.

On 25 May 2005 06:11:21 -0700, jUAN wrote:

>Thanks for the feedback Bruce. I actually tried doing
>"try...catch" and traping the exception error number, but I
>still get a PB error number, not Microsoft's defined error.
>I can't use your other approach ( ole_obj.Create() <= 0 )
>because if I get an error, I get a runtime error.
>
>FYI:
> MQ_ERROR_QUEUE_EXISTS = 3222142981 and when I get the
>error, PB returns 35. I am also pretty sure this is the
>value I should be getting back, the VB code reports this
>error, I should expect the same on PB, if I could get my
>hands on the error number.
>
>> Warning: I have not attempted to use the following, I'm
>> just converting on the fly:
>>
>> >Dim qInfo As MSMQ.MSMQQueueInfo
>> oleobject ole_msmq
>> ole_msmq = CREATE oleobject
>>
>> >
>> >On Error GoTo ErrHandler
>> try
>>
>> >Set qInfo = New MSMQ.MSMQQueueInfo
>> ole_msmq.ConnectToNewObject ( "MSMSQueueInfo" )
>>
>> >qInfo.Create
>>
>> I have no idea, because there's no reference to qInfo in
>> your snippet of code.
>>
>> >ErrHandler:
>>
>> catch ( OLERuntimeError e )
>>
>> >If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
>>
>> IF e.Number = (some constant you're going to have to
>> define manually ) THEN
>>
>> > 'Queue already exists
>>
>> Just a comment
>>
>> > Resume Next
>>
>> Nothing really. What you want to do is raise an error
>> message if it wasn't this error.
>>
>> >End If
>>
>> END IF
>>
>> The only caveat is that you might not get an exception,
>> you may get a negative return value from the
>> ConnectToNewObject call.
>>
>>
>> On 24 May 2005 11:09:48 -0700, "Juan" <juan@aol.com>
>> wrote:
>>
>> >Hi everybody, I am trying to port VB code to PB and I
>> runned into the Err >structure in VB. How can I port the
>> following code?: >
>> >Dim qInfo As MSMQ.MSMQQueueInfo
>> >
>> >On Error GoTo ErrHandler
>> >Set qInfo = New MSMQ.MSMQQueueInfo
>> >
>> >qInfo.Create
>> >
>> >ErrHandler:
>> >If Err.Number = MQ_ERROR_QUEUE_EXISTS Then
>> > 'Queue already exists
>> > Resume Next
>> >End If
>> >
>> >I know there is an Error object in PB, but the
>> error.number value it's a >specific PB error number. If I
>> use GetLastError() API, it comes back with 0. >I need to
>> find the equivalent (if any) of Err.Number value in PB. >
>>
>> Bruce Armstrong [TeamSybase]
>> http://www.teamsybase.com
>>
>> June ISUG Techcast: PowerBuilder .NET Compiler In-Depth
>> Review - June 7 & 9, 1:00 pm EDT
>> http://response.sybase.com/forms/JunISUGReg
>>
>> TeamSybase blogs:
>> http://www.teamsybase.net/blogs
>>
>> PowerBuilder Developer's Journal:
>> http://sys-con.com/pbdj/
>>
>> Two 3rd party books on developing with PowerBuilder
>> http://www.pb9books.com?source=newsgroups
>>
>> Need code sample? Check out CodeXchange:
>> http://www.codexchange.sybase.com
>>
>> Preach the gospel at all times. If necessary, use words. -
>> Francis of Assisi http://www.needhim.org
>>
>> ----------------------------------------------------------
>> ----------- NOTE:
>>
>> If you are using Google to post messages to the newsgroups
>> , you will *not* receive a reply. Messages posted through
>> Google never reach the Sybase newsgroup server, so we
>> don't see them in order to respond to them. You should
>> post your question using a standard newsgroup reader or
>> the web based newsreaders at my.sybase.com or
>> www.pfcguide.com. Google is great for searching the
>> Sybase newsgroups, but you can't post to them from there.
>>
>> ----------------------------------------------------------
>> ----------- DISCLAIMER:
>>
>> This newsgroup message is only intended for the recipient.
>> Given that it is a posting to a public newsgroup, that
>> means if you can read this message then you are the
>> recipient. This message may contain information that is
>> confidential and protected from disclosure. And then again
>> , it may not.
>>
>> Given that TeamSybase members are not employees of Sybase,
>> the contents of this message do not necessarily represent
>> the views or policies of Sybase. Given that TeamSybase
>> is a diverse group of users of Sybase products, the
>> contents of this message do not necessarily represent the
>> views of a significant number of the members of
>> TeamSybase. Given that the author has multiple
>> personalities and hears voices in his head, the contents
>> of this message do not necessarily represent his own
>> views.

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

June ISUG Techcast: PowerBuilder .NET Compiler In-Depth Review - June
7 & 9, 1:00 pm EDT
http://response.sybase.com/forms/JunISUGReg

TeamSybase blogs:
http://www.teamsybase.net/blogs

PowerBuilder Developer's Journal:
http://sys-con.com/pbdj/

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
NOTE:

If you are using Google to post messages to the newsgroups, you will
*not* receive a reply. Messages posted through Google never reach the
Sybase newsgroup server, so we don't see them in order to respond to
them. You should post your question using a standard newsgroup reader
or the web based newsreaders at my.sybase.com or www.pfcguide.com.
Google is great for searching the Sybase newsgroups, but you can't post
to them from there.

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.