Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Jul 24, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

PowerBuilder 5.0 datastores

I am 90 percent done building a product catalog using PB 5.0.2 and SQL Anywhere 5.5.

I just added a feature that uses a datastore to retrieve pricing information and update an onscreen datawindow. Here's an excerpt:

datastore lds_datastore
	lds_datastore = CREATE datastore
	lds_datastore.DataObject = "d_price"	// Assign SQL here
	lds_datastore.Retrieve (ls_item_nbr)	// Fetch a price
	ls_price = lds_datastore.GetItemDecimal(1,1)	
	DESTROY lds_datastore
This works great on my development box, but when I deploy I get the error "Application terminated. Error: Datawindow column type doesn't match Getitem type."

I can simulate this in development by changing the DataObject to d_prices, so it seems to me that PB can't find the d_prices datawindow in the runtime library on the deployed box.

I optimized and rebuilt the runtime library and the executable, but still no luck...

I think your diagnosis is correct: PowerBuilder cannot find the Datawindow object at runtime, so it gives you the error you describe.

This is normally caused by PowerBuilder not including the Datawindow object in your executable. When PowerBuilder builds your executable, it tries to be clever and checks recursively the PBLs for all the objects that are referenced by the application. Because your datawindow is referenced by a string d_price, PowerBuilder does not realize there is a reference to that object and thus does not include it in your executable.

To solve this problem you need to create a PBR (PowerBuilder Resource) file, which enables you to tell PowerBuilder to include an object it wouldn't normally include. These can include bitmaps, icons and datawindows.

Create a file and add the following entry:

where my_pbl is replaced with the library name where d_price is located. Then add the PBR file to the .exe resource file in the project painter and rebuild your executable.
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date