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.SetTransObject(SQLCA)	…	lds_datastore.Retrieve (ls_item_nbr)	// Fetch a price	ls_price = lds_datastore.GetItemDecimal(1,1)		dw_results_window.SetItem(ll_row,”suggest_retail_price”,ls_price)	…	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 cannotfind the Datawindow object at runtime, so it gives you the error you describe.

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

To solve this problem you need to create a PBR (PowerBuilderResource) file, which enables you to tell PowerBuilder to include anobject 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 painterand rebuild your executable.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may

man on floor with data

DevX Quick Guide to Data Ingestion

One of the biggest trends of the 21st century is the massive surge in internet usage. With major innovations such as smart technology, social media, and online shopping sites, the internet has become an essential part of everyday life for a large portion of the population. Due to this internet

payment via phone

7 Ways Technology Has Changed Traditional Payments

In today’s digital world, technology has changed how we make payments. From contactless cards to mobile wallets, it’s now easier to pay for goods and services without carrying cash or using a checkbook. This article will look at seven of the most significant ways technology has transformed traditional payment methods.