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.

Capturing DBError event in a DATASTORE?

5 posts in Objects Last posting was on 2007-03-23 21:12:59.0Z
Steve McKenna Posted on 2007-03-23 18:01:03.0Z
From: Steve McKenna <smckenna@talstar.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Capturing DBError event in a DATASTORE?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 164.51.156.8
X-Original-NNTP-Posting-Host: 164.51.156.8
Message-ID: <460415df$1@forums-1-dub>
Date: 23 Mar 2007 10:01:03 -0800
X-Trace: forums-1-dub 1174672863 164.51.156.8 (23 Mar 2007 10:01:03 -0800)
X-Original-Trace: 23 Mar 2007 10:01:03 -0800, 164.51.156.8
Lines: 19
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9304
Article PK: 736467

I'm migrating data from DB2 to SQL Server using a couple of DATASTORE
objects. I'm getting an error (non-zero return from the Update() method
of the datastore, but I can't seem to obtain the database error message,
even when I tried to print the database connection's SQLErrText property
as shown below.

li_Result = ds_sql_rs_static_data.Update()
IF (li_Result <> 1) THEN
SetPointer(Arrow!)
MessageBox("Problem:","Error inserting a row into the rs_static_data
table in SQL Server: " + MigrateSQLConn.SQLErrText,StopSign!)
RETURN -1
END IF

The PB help mentions that you can capture events (DBError) with a
non-visual DATASTORE, but I have no idea where or how to put this code
into PB.
Does anybody know?
=Steve=


Steve McKenna Posted on 2007-03-23 18:31:48.0Z
Message-ID: <46041D1D.3070803@talstar.com>
From: Steve McKenna <smckenna@talstar.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
To: Steve McKenna <smckenna@talstar.com>
Subject: Re: Capturing DBError event in a DATASTORE?
References: <460415df$1@forums-1-dub>
In-Reply-To: <460415df$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 164.51.156.8
X-Original-NNTP-Posting-Host: 164.51.156.8
Date: 23 Mar 2007 10:31:48 -0800
X-Trace: forums-1-dub 1174674708 164.51.156.8 (23 Mar 2007 10:31:48 -0800)
X-Original-Trace: 23 Mar 2007 10:31:48 -0800, 164.51.156.8
Lines: 25
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9305
Article PK: 736466

Found it: http://www.sybase.com/detail?id=47771
One must create a Standard Class User Object of type "DataStore", and
then place one of these user objects onto the window in question, then
the DataStore events show up in the script painter.
=Steve=

Steve McKenna wrote:
> I'm migrating data from DB2 to SQL Server using a couple of DATASTORE
> objects. I'm getting an error (non-zero return from the Update() method
> of the datastore, but I can't seem to obtain the database error message,
> even when I tried to print the database connection's SQLErrText property
> as shown below.
>
> li_Result = ds_sql_rs_static_data.Update()
> IF (li_Result <> 1) THEN
> SetPointer(Arrow!)
> MessageBox("Problem:","Error inserting a row into the rs_static_data
> table in SQL Server: " + MigrateSQLConn.SQLErrText,StopSign!)
> RETURN -1
> END IF
>
> The PB help mentions that you can capture events (DBError) with a
> non-visual DATASTORE, but I have no idea where or how to put this code
> into PB.
> Does anybody know?
> =Steve=


Scott Morris Posted on 2007-03-23 19:12:33.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <460415df$1@forums-1-dub> <46041D1D.3070803@talstar.com>
Subject: Re: Capturing DBError event in a DATASTORE?
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 65.205.162.2
X-Original-NNTP-Posting-Host: 65.205.162.2
Message-ID: <460426a1$1@forums-1-dub>
Date: 23 Mar 2007 11:12:33 -0800
X-Trace: forums-1-dub 1174677153 65.205.162.2 (23 Mar 2007 11:12:33 -0800)
X-Original-Trace: 23 Mar 2007 11:12:33 -0800, 65.205.162.2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9306
Article PK: 736463


"Steve McKenna" <smckenna@talstar.com> wrote in message
news:46041D1D.3070803@talstar.com...
> Found it: http://www.sybase.com/detail?id=47771
> One must create a Standard Class User Object of type "DataStore", and then
> place one of these user objects onto the window in question, then the
> DataStore events show up in the script painter.
> =Steve=

If you are working with a object (such as a window) that "contains" or
"uses" a datastore, then this is just extra overhead that isn't necessarily
required. In the painter of your object, there should be a menu for
View/Non-Visual Object List. Once this pane is open, you can insert nvo
objects (using the Insert/Object menu) and code their events from within the
painter as you can for any other embedded object.


Steve McKenna Posted on 2007-03-23 21:12:59.0Z
Message-ID: <460442E4.5020707@talstar.com>
From: Steve McKenna <smckenna@talstar.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
To: Scott Morris <bogus@bogus.com>
Subject: Re: Capturing DBError event in a DATASTORE?
References: <460415df$1@forums-1-dub> <46041D1D.3070803@talstar.com> <460426a1$1@forums-1-dub>
In-Reply-To: <460426a1$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 164.51.156.8
X-Original-NNTP-Posting-Host: 164.51.156.8
Date: 23 Mar 2007 13:12:59 -0800
X-Trace: forums-1-dub 1174684379 164.51.156.8 (23 Mar 2007 13:12:59 -0800)
X-Original-Trace: 23 Mar 2007 13:12:59 -0800, 164.51.156.8
Lines: 23
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9308
Article PK: 736469

Thanks Scott. This was an EXCELLENT post. Just when I thought I knew
every nook and cranny in PowerBuilder, you've shown me a whole nuther
world I didn't even know existed !!
Very helpful indeed!
=Steve=

Scott Morris wrote:
> "Steve McKenna" <smckenna@talstar.com> wrote in message
> news:46041D1D.3070803@talstar.com...
>> Found it: http://www.sybase.com/detail?id=47771
>> One must create a Standard Class User Object of type "DataStore", and then
>> place one of these user objects onto the window in question, then the
>> DataStore events show up in the script painter.
>> =Steve=
>
> If you are working with a object (such as a window) that "contains" or
> "uses" a datastore, then this is just extra overhead that isn't necessarily
> required. In the painter of your object, there should be a menu for
> View/Non-Visual Object List. Once this pane is open, you can insert nvo
> objects (using the Insert/Object menu) and code their events from within the
> painter as you can for any other embedded object.
>
>
>


Steve McKenna Posted on 2007-03-23 19:12:56.0Z
Message-ID: <460426C0.6000808@talstar.com>
From: Steve McKenna <smckenna@talstar.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
To: Steve McKenna <smckenna@talstar.com>
Subject: Re: Capturing DBError event in a DATASTORE?
References: <460415df$1@forums-1-dub> <46041D1D.3070803@talstar.com>
In-Reply-To: <46041D1D.3070803@talstar.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 164.51.156.8
X-Original-NNTP-Posting-Host: 164.51.156.8
Date: 23 Mar 2007 11:12:56 -0800
X-Trace: forums-1-dub 1174677176 164.51.156.8 (23 Mar 2007 11:12:56 -0800)
X-Original-Trace: 23 Mar 2007 11:12:56 -0800, 164.51.156.8
Lines: 40
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9307
Article PK: 736465

Sorry, I mis-interpreted what the web page was saying. What I ACTUALLY
ended up having to do was the following:
1. Create the new nvo_ds class, and delcare a couple of instance
variables to hold the LastErrorReceived (string), and the SQLSent (string).
2. Coded the DBError event in this nvo_ds class to populate the two
instance variables above.
3. In the script where I used to use the DATASTORE, I simply replaced
DATASTORE type with the new nvo_ds type.
4. When an error is detected (i.e. - the Update() method returns
non-zero value), I simply inspect the values of the LastErrorReceived
and SQLSent instance vars.
Nifty!
=Steve=

Steve McKenna wrote:
> Found it: http://www.sybase.com/detail?id=47771
> One must create a Standard Class User Object of type "DataStore", and
> then place one of these user objects onto the window in question, then
> the DataStore events show up in the script painter.
> =Steve=
> Steve McKenna wrote:
>> I'm migrating data from DB2 to SQL Server using a couple of DATASTORE
>> objects. I'm getting an error (non-zero return from the Update()
>> method of the datastore, but I can't seem to obtain the database error
>> message, even when I tried to print the database connection's
>> SQLErrText property as shown below.
>>
>> li_Result = ds_sql_rs_static_data.Update()
>> IF (li_Result <> 1) THEN
>> SetPointer(Arrow!)
>> MessageBox("Problem:","Error inserting a row into the
>> rs_static_data table in SQL Server: " +
>> MigrateSQLConn.SQLErrText,StopSign!)
>> RETURN -1
>> END IF
>>
>> The PB help mentions that you can capture events (DBError) with a
>> non-visual DATASTORE, but I have no idea where or how to put this code
>> into PB.
>> Does anybody know?
>> =Steve=