1. Juan Jara
  2. PowerBuilder
  3. Friday, 21 January 2022 12:06 PM UTC

Hi,

I have a powerbuilder executable that closes unexpectedly on the instruction: dw_1.dataObject = ls_dataobject
where ls_dataObject is not null and de dw_1 is valid.

This happens on some computers not all with the same executable.

Any idea?

Thank you in advanced,

Juan




Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 21 January 2022 13:18 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Juan;

  You should never assign the DataObject property like that. I'm surprised that it works sometimes without crashing the App every time.

   Instead, you should ...

  • String  ls_dwo
  • ls_dwo = DC.dataObject
  • DC.Reset()
  • DC.DataObject  = ""
  • Yield ()
  • DC.DataObject = ls_dwo
  • DC.SetTransObject ( SQLCA )

HTH 

Regards... Chris

 

 

 

 

 

 

Comment
  1. Miguel Leeuwe
  2. Monday, 24 January 2022 10:01 AM UTC
Can you show us the complete code?
  1. Helpful
  1. Juan Jara
  2. Friday, 28 January 2022 10:28 AM UTC
I finally found the solution to the problem. I had to do a sharedataoff before assigning the dataobject but on some computers when assigning the dataobject I had an unexpected closure of the application.



thanks to all



Juan
  1. Helpful 1
  1. Armeen Mazda @Appeon
  2. Friday, 28 January 2022 10:35 AM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Juan Jara Accepted Answer Pending Moderation
  1. Friday, 21 January 2022 12:54 PM UTC
  2. PowerBuilder
  3. # 1

Hi Benjamin,

Thanks for answering.

That is not my case because I have a executable with PBDs.

 

The DW already had a dataobject and working correctly and what I do I reassign the dataobject to initialize the DW (dw_1.dataObject = dw_1.dataObject) and it is at this moment that it breaks.

 

Regards, Juan

 

 

Comment
  1. mike S
  2. Friday, 21 January 2022 14:56 PM UTC
it is most likely something in the datawindow itself that is causing the problem. get the syntax exported and look at it. do you use any global functions in the datawindow?



dw_1.dataObject = dw_1.dataObject is not what you originally posted.

What causes the crash, this code or the code in your original post? you should also state what version of PB you are running.



  1. Helpful
There are no comments made yet.
Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Friday, 21 January 2022 12:41 PM UTC
  2. PowerBuilder
  3. # 2

Hi Juan,

this usually happens when you deploy a single executable without PBDs because "loose" objects without explicit references (Datawindows are the most common pitfall, but also other objects that are created via "create using '<objectname>' ") are not compiled into the executable. Either set your PB project to create PBDs or add references to the Datawindow .srd files into a resource file (.pbr) attached to the project.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.