Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Maximum characters to be used while naming a powerbuilder object

While naming an object in Powerbuilder, the maximum length is 40. Which means if I name datawindow object as d_composite_reporting_yearly_sales_figures, this is invalid and will throw error during runtime. Counting the underscores and characters in the name, they are 42.

For demonstration, lets create a datawindow and name it as d_composite_reporting_yearly_sales_figures. The datawindow will be saved with name and display in the treeview.





Now right click on the object and Select Export.



Observe the name has been trimmed.If datawindow is used in powerscript, check the dataobject name in debug mode.

The 40 character length applies to all objects like window, user objects, structures etc.



Invalid Datawindow row/column specified at line xx


Error: Invalid DataWindow row/column specified at line xxx in function of _funct of oject n_cst_xyz."

 Click OK -> "Application terminated. Error: Null object reference at line 27 in XYZ event of object n_cst_xyz."

Possible Reasons:
  • Rows Retrieved is zero.
  • Incorrect column name specified in the script.
  • There might be a row retrieved, but there may not be a row in the primary buffer.

DataWindow Error: Row changed between retrieve and update

Normally this problem comes in multiuser scenarios where some other user has modified the record on which you are working. In a single user scenario this will come only if the datawindow flags have not been properly set/reset after an update command.

The best way to avoid the "row changed between retrieve and update" error is to use the "Key columns" update option. If you have timestamps or fields updated by triggers including them in the update statement ("Key and updateable columns") can cause problems.

API CALL Error messages in Powerbuilder



 1. Error: Error opening DLL library for external function at line in the event of object  of .

     Possible causes:
     > DLL is 16 bit and thus incompatible.
     > DLL is not in a searchable directory.
     > DLL connects to another DLL that cannot be found.
     > DLL has the same name as another already loaded into memory.
     > DLL is corrupted or in an incompatible format.

     2. Error: Error calling external function at line in the event of object of
     .
     This is probably the result of an incorrectly spelt function name. Be sure to verify that the function name matches what is in the DLL exactly, including the case of the letters.

     3. Error: Specified argument type differs from required argument type at runtime in DLL function . (Invalid stack pointeron return from function call) at line in event of object of.

     This error usually indicates the datatypes do not match what the DLL function is expecting.

     4. Receiving garbage from the DLL. i.e. Last name populated as: "*#^&Ashish"

     This problem is most likely the result of the byte alignment being set incorrectly. PowerBuilder expects the byte alignment to be set to one
     and if you are using MSVC++ compiler the default setting is four. To set the byte alignment to one you would need to do the following prior
     to compiling to a dll.

     - Select the desired target
     - Right mouse click and select Settings
     - Select the C/C++ tabpage
     - Select Code Generation from the Category dropdown list
     - Select desired byte alignment from the Struct Member Alignment dropdown list.

     The DOS switch to set the byte alignment to one is: /zp1