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…
You are currently browsing all posts tagged with programming
PowerBuilder – Connect to SQLite version 3 database (ODBC)
PowerBuilder – Type ahead style dropdown datawindow columns
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 – Treeview like Tooltips for Datawindows
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 – Filter vs Find performance
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 – Application path
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 – Accessing C# Classes via COM to Capture a Screenshot
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 – Setting column value without looping through all rows.
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 – Development vs. Production Mode
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 – PFC String service extension
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…
Sequence Numbers in SQL
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.