You are currently browsing all posts tagged with programming

PowerBuilder – Connect to SQLite version 3 database (ODBC)

Posted on June 14, 2011 at 8:20 pm in

If you are interested in doing PowerBuilder development with an SQLite database here is the DSN Less connection string to get you going. string ls_dbparm, ls_dbfile, ls_exepath, ls_file[] ls_dbfile = c:\temp\sqlite.db3' IF Fileexists(ls_dbfile) THEN // do nothing ELSE IF GetFileOpenName('Select Data File',ls_dbfile, ls_file,'db3','SQLite files (*.db3),*.db3') < 1 THEN Messagebox('No Data File Chosen','Application will close') HALT…

PowerBuilder – Connect to SQLite version 3 database (ODBC) - the full story »

PowerBuilder – Type ahead style dropdown datawindow columns

Posted on June 6, 2011 at 8:20 pm in

This type of functionality is one of those things which fills a gap so completely and perfectly that when you encounter some application (and almost all web pages) which doesn’t have it you groan to yourself. In the ancient past this was alternatively referred to as ‘Quicken style’ dropdowns since that application was one very…

PowerBuilder – Type ahead style dropdown datawindow columns - the full story »

PowerBuilder – Treeview like Tooltips for Datawindows

Posted on May 18, 2011 at 8:20 pm in

The treeview control has a very neat piece of functionality built in called Tooltips. When this property is checked your application will automatically display all the text on a treeview item if it is cut off by the edge of the control when the mouse pointer goes over that row. If the row text is…

PowerBuilder – Treeview like Tooltips for Datawindows - the full story »

PowerBuilder – Filter vs Find performance

Posted on May 6, 2011 at 8:20 pm in

If you have rows in a datawindow/datastore and you want to look through them for a match against some new code (say you are looking for an existing entry so you can add to the quantity), it is better to use the Find method in a loop than to use the Filter method. Filtering large…

PowerBuilder – Filter vs Find performance - the full story »

PowerBuilder – Application path

Posted on April 19, 2011 at 8:20 pm in

So you need to check some file you have deployed with your application and you have chosen to put it in the same folder as the executable. Sure, I’ll just check the current folder when the application launches and I’ll have what I need. Wrong. Since an application can be launched with a ‘Start In’…

PowerBuilder – Application path - the full story »

PowerBuilder – Accessing C# Classes via COM to Capture a Screenshot

Posted on April 12, 2011 at 8:20 pm in

I was working with setting up screen capture functionality from within a PB11.5 application recently and came up against a wall which forced me to rethink my strategy. Initially I was using External Functions to the Windows gdi32.dll but had issues with my code causing it to ‘stop working’ after a few files were written.…

PowerBuilder – Accessing C# Classes via COM to Capture a Screenshot - the full story »

PowerBuilder – Setting column value without looping through all rows.

Posted on March 3, 2011 at 8:00 pm in

A question came up on the TekTips website about setting a column in all the rows in a datawindow to the same value without looping through. In this case the writer was loading data from over one hundred Excel files and wanted to track the filename of where the data came from. At first I…

PowerBuilder – Setting column value without looping through all rows. - the full story »

PowerBuilder – Development vs. Production Mode

Posted on February 22, 2011 at 8:20 pm in

You can set up a variety of helpful methods for use while developing an application which you don’t want users to get their hands on when in production. One example of this is my Window Information Service . To make this only available when running from the Powerbuilder IDE use the following steps. Set up…

PowerBuilder – Development vs. Production Mode - the full story »

PowerBuilder – PFC String service extension

Posted on February 21, 2011 at 8:20 pm in

Here is a simple modification to the PFC string service (n_cst_string) which will parse out an array of any datatype and returned a delimited string of the contents. The new method is a polymorph of the existing of_arraytostring. public function long of_arraytostring (any aa_array[], string as_delimiter, ref string as_string) // convert array to string array…

PowerBuilder – PFC String service extension - the full story »

Sequence Numbers in SQL

Posted on February 7, 2011 at 8:20 pm in

Here is a link to a very good article on SQLServerCentral.com showing a technique to re-sequence items via a database stored procedure rather than on the client. It’s pretty straight forward and solves a fairly common issue I’ve addressed several times in PowerBuilder over the years.

Sequence Numbers in SQL - the full story »

Top