You are currently browsing the Programming category

PowerBuilder ‘Gotcha’ – Malformed Imbedded SQL

Posted on October 7, 2010 at 8:20 pm in

I came across a statement like this while tracking down a separate issue and at first didn’t think much of it since it wasn’t related to the problem at hand. However, when running my process through the debugger I noticed a SQL error which caught my attention. <code>UPDATE dbo.shipperDetail SET contractId = (SELECT max(docId) FROM…

PowerBuilder ‘Gotcha’ – Malformed Imbedded SQL - the full story »

My Favorite Programming Term

Posted on October 7, 2010 at 8:20 pm in

For a, thankfully, very brief time I was exposed to ‘Uniface’, the supposed ‘universal’ programming language currently offered by Compuware (in the early 2000’s). It does, however, make use of my now favorite programming term: $hits. From this source. (link gone dark) 3.3 setocc, currocc, totdbocc, $hits 3.3.1 Why should I be careful about using…

My Favorite Programming Term - the full story »

PowerBuilder – Window object resizer bar

Posted on October 5, 2010 at 8:30 pm in

Here is a fairly simple technique to allow for the resizing of objects on a window. Its best use is to provide a ‘splitbar’ type of control to dynamically shrink and enlarge the amount of space on a window a pair of datawindow objects occupy. If you really want to get fancy you will save…

PowerBuilder – Window object resizer bar - the full story »

Powerbuilder – PFC Resize Service Extension / Max Height & Width

Posted on September 29, 2010 at 8:25 pm in

The PFC window resize service is one of my favorite things in the entire class library as it can easily be implemented and adds a great bit of functionality to an application. One drawback, however, is there is no built in capability to limit the resizing of the objects on a window; either they resize…

Powerbuilder – PFC Resize Service Extension / Max Height & Width - the full story »

Comment on Powerbuilder – PFC Resize Service Extension / Max Height & Width »

PowerBuilder – Getting Active Directory information

Posted on September 27, 2010 at 8:00 pm in

Here is a handy bit of OLE to retrieve Active Directory information. oleobject ads string ls_stuff ads = CREATE OleObject ads.ConnectToNewObject( "ADSystemInfo" ) ls_stuff = 'User: ' + String(ads.UserName) ls_stuff += '~n~r' + 'Computer: ' + string(ads.ComputerName) ls_stuff += '~n~r' + 'Domain: ' + string(ads.DomainDNSName) ls_stuff += '~n~r' + 'Domain short: ' + string(ads.DomainShortName) ls_stuff…

PowerBuilder – Getting Active Directory information - the full story »

SQL Server Date & Datepart formats

Posted on September 24, 2010 at 8:24 pm in

Here is a handy cheat sheet for dates in SQL Server: — DATEPART SAMPLES select 'Year: ' + CONVERT(NVARCHAR(4),datepart(year, GETDATE())) select 'Quarter: ' + CONVERT(CHAR(1),datepart(quarter , GETDATE())) select 'Month: ' + CONVERT(NVARCHAR(2),datepart(month, GETDATE())) select 'Day of Year: ' + CONVERT(NVARCHAR(3),datepart(dayofyear, GETDATE())) select 'Day of Month: ' + CONVERT(NVARCHAR(2),datepart(day, GETDATE())) select 'Week: ' + CONVERT(NVARCHAR(2),datepart(week, GETDATE()))…

SQL Server Date & Datepart formats - the full story »

PowerBuilder ‘Gotcha’ – Quoted Identifiers

Posted on September 21, 2010 at 8:20 pm in

Be careful when developing against any database which supports quoted identifiers (I know, who doesn’t)? Anyway it is real easy to forget and ‘turn off’ this option on your local db (or your development connection) and end up releasing a bug by a simple SQL alteration like this: –Original SQL SELECT partNo , partDesc FROM…

PowerBuilder ‘Gotcha’ – Quoted Identifiers - the full story »

PowerBuilder – Special Effects Popup

Posted on September 20, 2010 at 8:40 pm in

A question came up on Tek-tips forum regarding creating a special effects popup window. These are the kind which come up from the bottom right corner of your display to tell you your virus data has been updated or some such important message. Many times these are also semi transparent and even go away after…

PowerBuilder – Special Effects Popup - the full story »

PowerBuilder – Datawindow SQL changes made easy

Posted on September 16, 2010 at 8:20 pm in

One application I developed involved retrieving from a large dataset based on any number of criteria. Yea, I know, this sounds just like the application you worked on right? Anyway, there are a variety of ways to achieve this in PB but the one approach I like best when dealing with a variable number of…

PowerBuilder – Datawindow SQL changes made easy - the full story »

PowerBuilder – Things to Avoid

Posted on September 2, 2010 at 8:16 pm in

“Give someone enough rope and he’ll hang himself” There are a number of things to avoid in Powerbuilder since they are either resource hogs or make maintenance/debugging a real pain. In no particular order. Code in the Other event I worked for awhile on a large accounting application, a commercially available product, written in PB…

PowerBuilder – Things to Avoid - the full story »

Top