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…
You are currently browsing all posts tagged with Powerbuilder
PowerBuilder – Getting Active Directory information
PowerBuilder ‘Gotcha’ – Quoted Identifiers
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 – Special Effects Popup
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 ‘Gotcha’ – Datawindow update properties
So a customer is complaining that their data is ‘auto-magically’ changing and there is ‘no way anyone here is doing it since I’m the only one who knows how’. Blah, blah, blah. Solution? – database trigger to log when something is changed on the specified table. Now you go to the datawindow object which handles…
PowerBuilder – Datawindow SQL changes made easy
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 ‘Gotcha’ – pfc Resize service and Tabpages
The window resize service is one of the best features of the PFC. With a few lines of code you can easily make your application much more resolution independent and user friendly. Something else which makes this service pretty cool is that it can be easily un-copoled from the rest of the pfc. All you…
PowerBuilder – Things to Avoid
“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 – Capture Images from Webcam
Here’s some code to capture an image from a webcam in Powerbuilder using EZTWAIN. It worked fine on my Vista Home Premium laptop. I came across it earlier in 2010 but the blog page seems to be gone now. If you know the author, let me know so I can give credit. The file and…
PowerBuilder – Color settings
There are still many Powerbuilder web sites with this information but it is an invaluable resource unless you are the kind of person who can memorize these things. This is a color conversion chart that gives the RGB values for the standard 16 colors and some of the system colors. Color Red Green Blue Long…
PowerBuilder ‘Gotcha’ – Null Messagebox
As with many methods in Powerbuilder, the ‘Messagebox’ function returns a NULL if any of the paramenters you send it are NULL. This can be problematic in your ‘defensive programming’ situations where you are informing the user of some type of error or condition. For Example: ls_value = TRIM(data) IF Len(ls_value) > 0 THEN SELECT…