1. Aleš Vojáček
  2. PowerBuilder
  3. Monday, 6 December 2021 23:25 PM UTC

Hi all,

I'm pretty frustrated, I do not know if i can describe my problem properly, but I will try to.

I wanted to use DataStore as instance variable on my window.

If I tried that and run application from PB everything woked smoothly.

But as soon as I tried deploy and run exe my app did not work.

Whne I inserted line into datastore I got -1 back.

my_datastore.insertrow(0) returned -1.

Nothing helped, I tried to reset datastore before insertrow, still nothing. It only worked properly when it was executed from PB.

I tried to use invisible DataWindow istead of DataStore and it wokrs. (From PB and from exe).

There are no childdw, nothing fancy only grid dw with SQL as datasource.

 

Is there somethin what I could miss, or is DataStore unusable?

Best Regards.

Ales

PS. Using latest PB 21 IDE and Runtime.

Brad Mettee Accepted Answer Pending Moderation
  1. Tuesday, 7 December 2021 16:22 PM UTC
  2. PowerBuilder
  3. # 1

John,

Why would you export the datawindow to SRD to include it in the build? If you reference "main.pbl(dw_name)" in the PBR you'll never have to export the object to have it included in the app. By exporting it, you're just adding another layer to the build that needs to be done to keep it in sync with what's in the pbl. It's much simpler to have it included directly.

HTH

 

 

Comment
  1. Miguel Leeuwe
  2. Tuesday, 7 December 2021 17:11 PM UTC
Ah ... just replied to John too. Didn't see your comment before.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 December 2021 02:52 AM UTC
  2. PowerBuilder
  3. # 2

Hi Aleš;

  Make sure that you deploy all your PBL's as PBD's if compiling to P-Code. If compiling to M-Code, then deploy all your PBL's as DLL's . That should resolve this problem.  HTH

Regards ... Chris

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 7 December 2021 02:23 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Ales -

If you compiled the app into machine code, then you need to:

1, Export the DataWindow data object source (produce a .srd file).

2. Create a PB Resource (.pbr) file, if the app does not already have one.

3. List the d_xxxxxx.srd file in the resource file.

4. Re-build/deploy the machine code exe and dll's.

Without a .pbd file that contains the data object, the runtime engine cannot find the .srd. Including the .srd in the .pbr file ensures it gets included into the app.

Best regards, John

Comment
  1. Aleš Vojáček
  2. Tuesday, 7 December 2021 20:47 PM UTC
@Miguel,

I think, that DataStore should work as DataWindow control, so you do not have to reference DataWindow in PBR file. I hope that make sense, because how it works now is not too much intuitive.

A.
  1. Helpful
  1. Roland Smith
  2. Wednesday, 8 December 2021 14:04 PM UTC
This problem only occurs when the app is compiled to just an EXE. If PBD files are created, you don't need the .pbr file.

The reason datawindow objects referenced by a datawindow control are included but datastores are not is that the DWC reference is a property and a DS is usually assigned in script. If you create a datastore object and assign the datawindow object to that, it should be included.
  1. Helpful
  1. Arnd Schmidt
  2. Wednesday, 8 December 2021 15:34 PM UTC
Hi Roland,

Should be included:: Yes!

Will be included: No. :-(
  1. Helpful
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.