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.

Any one know why am I getting this NULL object reference error

5 posts in Objects Last posting was on 2002-10-23 09:30:47.0Z
Raj Posted on 2002-10-21 20:25:32.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Raj
Date: Mon, 21 Oct 2002 16:25:32 -0400
Subject: Any one know why am I getting this NULL object reference error
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_D07C903D1E5C13740070332985256C59.0070339885256C59@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:850
Article PK: 713412

Hi Friends,

I am calling a global function from the Protect property of a datawindow
column of edit type check box.
In window Object painter, when I open the window having the above said
datawindow I am getting the message saying 'NULL object reference at line
11 in function gf_are_payments_exist of object gf_are_payments_exist .

Function complied without errors.

The function called is:

public Boolean gf_are_payments_exist (....)

Long ll_count

Select count(*)
Into :ll_count
From Tcal_Payments
Where tax_year = :stax_year and
legal_Entity_id = :slegal_entity_id and
legal_entity_type = :slegal_entity_type and
filing_obligation = :sfiling_obligation;

If ll_count > 0 Then
Return TRUE
ElseIf ll_count = 0 Then
Select count(*)
Into :ll_count
From Tcal_Pymt_amendment
Where tax_year = :stax_year and legal_Entity_id = :slegal_entity_id
and legal_entity_type = :slegal_entity_type and filing_obligation =
:sfiling_obligation;
If ll_count > 0 Then
Return TRUE
ElseIf ll_count = 0 Then
Return FALSE
ElseIf ll_count < 0 Then
MessageBox("O.S.C.A.R", "Database Error Occurred.")
Return FALSE
End If
ElseIf ll_count < 0 Then
MessageBox("O.S.C.A.R", "Database Error Occurred.")
Return FALSE
End If


Bruce Armstrong [TeamSybase] Posted on 2002-10-22 01:33:05.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Organization: TeamSybase [12.13.238.140]
X-Newsreader: AspNNTP 1.50 (C I Host)
Subject: Re: Any one know why am I getting this NULL object reference error
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Mon, 21 Oct 2002 21:33:05 -0400
Lines: 61
NNTP-Posting-Host: 66.221.40.1
Message-ID: <364_1GK63rWeCHA.279@forums.sybase.com>
References: <364_D07C903D1E5C13740070332985256C59.0070339885256C59@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:849
Article PK: 713413

In the development environment, SQLCA doesn't exist and so attempts to use it
(via embedded SQL in your global function for example) will result in errors.
You might add code to that global function to check to see if it's being run in
the runtime or development environment, so that it returns something if it knows
SQLCA won't be available.

On Mon, 21 Oct 2002 16:25:32 -0400,
in powersoft.public.powerbuilder.objects

<Raj> wrote:
>Hi Friends,
>
>I am calling a global function from the Protect property of a datawindow
>column of edit type check box.
>In window Object painter, when I open the window having the above said
>datawindow I am getting the message saying 'NULL object reference at line
>11 in function gf_are_payments_exist of object gf_are_payments_exist .
>
>Function complied without errors.
>
>The function called is:
>
>public Boolean gf_are_payments_exist (....)
>
>Long ll_count
>
>Select count(*)
>Into :ll_count
>From Tcal_Payments
>Where tax_year = :stax_year and
>legal_Entity_id = :slegal_entity_id and
>legal_entity_type = :slegal_entity_type and
>filing_obligation = :sfiling_obligation;
>
>If ll_count > 0 Then
> Return TRUE
>ElseIf ll_count = 0 Then
> Select count(*)
> Into :ll_count
> From Tcal_Pymt_amendment
> Where tax_year = :stax_year and legal_Entity_id = :slegal_entity_id
>and legal_entity_type = :slegal_entity_type and filing_obligation =
>:sfiling_obligation;
> If ll_count > 0 Then
> Return TRUE
> ElseIf ll_count = 0 Then
> Return FALSE
> ElseIf ll_count < 0 Then
> MessageBox("O.S.C.A.R", "Database Error Occurred.")
> Return FALSE
> End If
>ElseIf ll_count < 0 Then
> MessageBox("O.S.C.A.R", "Database Error Occurred.")
> Return FALSE
>End If

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

Join us for the PB9 WebCasts, October 29th and 30th
http://www.sybase.com/detail/1,6904,1021571,00.html

Not 1 - but 2 new books on developing with PowerBuilder
http://www.pb9books.com

If you would like to continue to be able to use Google
to search *all* of these newsgroups, please contact
Google at and let them know.
mailto:groups-support@google.com

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


Raj Posted on 2002-10-22 18:31:22.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Raj
Date: Tue, 22 Oct 2002 14:31:22 -0400
Subject: Re: Any one know why am I getting this NULL object reference error
Lines: 9
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_5D253219933443E60065BFEF85256C5A.000D8CF985256C5A@webforums>
References: <364_D07C903D1E5C13740070332985256C59.0070339885256C59@webforums> <364_1GK63rWeCHA.279@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:846
Article PK: 713410

Thanks.

But, how do I get whether application is running in runtime or development
evironment?

I tried using Handle(getapplication()). doesn't work.

Thanks
Raj


Simon Caldwell [TeamSybase] Posted on 2002-10-23 09:30:47.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Simon Caldwell [TeamSybase]" <simonDOTcaldwellATbigfootDOTcom>
Subject: Re: Any one know why am I getting this NULL object reference error
Date: Wed, 23 Oct 2002 10:30:47 +0100
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: ip-80-242-36-231.aramiska-arc.aramiska.net 80.242.36.231
Message-ID: <364_fBp3JkneCHA.197@forums.sybase.com>
References: <364_D07C903D1E5C13740070332985256C59.0070339885256C59@webforums> <364_1GK63rWeCHA.279@forums.sybase.com> <364_5D253219933443E60065BFEF85256C5A.000D8CF985256C5A@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:840
Article PK: 713398

Handle(GetApplication()) *does* work, we use this technique regularly.
It should go at the start of gf_are_payments_exist, something like
if Handle(GetApplication()) = 0 then return true

Simon

--
All views expressed in this message are my own and not necessarily those of
my employer

<Raj> wrote in message
news:5D253219933443E60065BFEF85256C5A.000D8CF985256C5A@webforums...
> Thanks.
>
> But, how do I get whether application is running in runtime or development
> evironment?
>
> I tried using Handle(getapplication()). doesn't work.
>
> Thanks
> Raj


Bruce Armstrong [TeamSybase] Posted on 2002-10-23 08:53:37.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Organization: TeamSybase [66.214.149.29]
X-Newsreader: AspNNTP 1.50 (C I Host)
Subject: Re: Any one know why am I getting this NULL object reference error
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Wed, 23 Oct 2002 04:53:37 -0400
Lines: 30
NNTP-Posting-Host: 66.221.40.1
Message-ID: <364_t3$7sGneCHA.162@forums.sybase.com>
References: <364_D07C903D1E5C13740070332985256C59.0070339885256C59@webforums> <364_1GK63rWeCHA.279@forums.sybase.com> <364_5D253219933443E60065BFEF85256C5A.000D8CF985256C5A@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:842
Article PK: 713409

It should. You might also try IsValid or dbHandle on SQLCA.

On Tue, 22 Oct 2002 14:31:22 -0400,
in powersoft.public.powerbuilder.objects

<Raj> wrote:
>Thanks.
>
>But, how do I get whether application is running in runtime or development
>evironment?
>
>I tried using Handle(getapplication()). doesn't work.
>
>Thanks
>Raj

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

Not 1 - but 2 new books on developing with PowerBuilder
http://www.pb9books.com

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

NOTE: Please do NOT attempt to post to these newsgroups through news
services such as Google, as your messages will NOT appear on the
server. If you want to use a web based newsreader to post, use the
one at my.sybase.com or www.pfcguide.com.

Google used to be great for searching these newsgroups, but they no
longer appear to be maintaining the feed. If you would like to
continue to be able to use Google to search these newsgroups, and
would like all of the newsgroup sections archived, please contact
Google at groups-support@google.com and let them know.