This method is used with a SQL Anywhere database to ensure that any given user can only sign on the application once. It uses the connection_property function so make sure you either give the users permission to execute this or set up a separate connection which uses an id which has the permissions. There are…
You are currently browsing all posts tagged with programming
PowerBuilder – Single user sign on verification for SQL Anywhere
PowerBuilder & MS SQLServer datetime methods
If you have scheduling functionality in your application sooner or later you are faced with spanning dates. By this I mean starting something on one day and ending it on another. Powerbuilder is not very good at this, especially if you have something which starts before midnight and ends after midnight. SQL Server provides good…
PowerBuilder ‘Gotcha’ – dddw Edit Type
Be careful when you change the columns in a datawindow object referenced in another datawindow object when using the DropDownDatawindow Edit Type. If you change the column name which is referenced in the DDDW Edit Type of another you won’t get a compile error when saving – but you will get runtime errors. This happened…
PowerBuilder – Lookup the Display value of a DDDW column
It’s a pretty typical situation where you want to know the value displayed in a dropdown datawindow even though behind the scenes only the ID is saved. Here is a technique you can use to look up the value in any row in the datawindow. ls_describe = “Evaluate(‘LookUpDisplay(part_id)’, ” + string(ll_found) + “)”//ll_found is the…
Comment on PowerBuilder – Lookup the Display value of a DDDW column »
PowerBuilder – Change Background of Modified Columns in Datawindow
Okay so you have a datawindow with a bunch of rows which can be edited (a grid datawindow is a good choice). So when the user pulls up the data set and proceeds to change values in a variety of columns and a variety of rows you want to indicate to him that the specific…
PowerBuilder – Simple ‘Windows Standard’ Row Selection
Allowing for ‘Windows Standard’ muli row selection is pretty straight forward. By ‘Windows Standard’ I mean you can select a range by clicking on a row, holding the shift key and clicking on a second row to select all the rows between the two or by holding down the control key and clicking you can…
Powerbuilder – Evaluating Arithmetic Expressions
Below is a function which allows the user to enter an arithmetic expression and then evaluate it and return the result. This will work for addition (+), subtraction(-), multiplication(*), division(/), and exponentiation(^). You can also enter parenthesis to change the order of precedence if needed. You would call this from where ever you like to…
PowerBuilder – Populate a dropdownlistbox from a SQL statement
Here is a method to populate a dropdownlistbox control with values from a sql statement. Since it is based on a datastore you can easily apply filters, sorts, etc. prior to populating the dropdownlistbox with values. The code assumes the first column in the SQL is going to be used to populate the dropdownlistbox .…
PowerBuilder – ‘Smart’ Crosstab Datawindow
I had a question from a co-worker regarding a functionality request from a user. Basically they wanted a datawindow to display information for vendors (basic stuff like name, amt 1, amt 2, amt 3, etc.) for a specific set of amount columns. Each line represents one vendor and the various amounts (if any) with a…
Look what I found
Work long enough as a programmer and you will no doubt find something in the source code which is a) unintelligible b) ridiculous c) very funny. This category is devoted to these things. Found in a stored procedure: {lots of stuff went on before this point} —- Begin Actual code —- commit; –We will probably…