Migrating PowerBuilder Applications
You can migrate a PowerBuilder application from any version of PowerBuilder directly to any later version. Before you migrate to a later version, read this document to learn about changes in PowerBuilder that might affect your application.
This document addresses changes between PowerBuilder 6.5 and PowerBuilder 12.5. Read all sections that apply to your application. Subsections with IM in parentheses after their titles also apply to InfoMaker.
- Migrating from any PowerBuilder version
- Migrating from PowerBuilder 12.1 or earlier
- Migrating from PowerBuilder 12.0 or earlier
- Migrating from PowerBuilder 11.5.1 or earlier
- Migrating from PowerBuilder 11.5 or earlier
- Migrating from PowerBuilder 11.2 or earlier
- Migrating from PowerBuilder 11.1 or earlier
- Migrating from PowerBuilder 11.0 or earlier
- Migrating from PowerBuilder 10.5 or earlier
- Migrating from PowerBuilder 10 or earlier
- Migrating from PowerBuilder 9 or earlier
- Migrating from PowerBuilder 8 or earlier
- Migrating from PowerBuilder 7 or earlier
- Migrating from PowerBuilder 6.5 or earlier
1 Migrating from any PowerBuilder version
1.1 Migration Assistant
Before opening PBLs that were created in an earlier version, use the Migration Assistant in the new version to check them for obsolete syntax or the use of new reserved words. To open the Migration Assistant, select File>New from the PowerBuilder menu bar and select Migration Assistant from the Tools page of the New dialog box.
1.2 Migrating PBLs
You must migrate PBLs created with earlier versions of PowerBuilder to the new version. You should always back up PBLs and PBTs before you migrate.
The Migrate Application dialog box opens automatically after you open a workspace that contains PowerScript targets built using an earlier version. If you add a PBT containing such PBLs to an open workspace, or add PBLs built in an earlier version of PowerBuilder to a target's library list, the Migrate Application dialog box does not open automatically. To open the dialog box, select each target that contains PBLs created using earlier versions of PowerBuilder in the System Tree and select Migrate from the pop-up menu.
Please read the section on migrating targets in the PowerBuilder User's Guide before migrating your applications.
1.3 Migrating database profiles (IM)
To use database profiles that were set up in an earlier version of PowerBuilder, right-click any item in the Database Profiles dialog box in the earlier version of PowerBuilder and select Export Profile(s) from the pop-up menu. You can then import the profiles you select in the Database profiles dialog box in the later version of PowerBuilder.
1.4 Runtime DLLs (IM)
The applications that you build using any version of PowerBuilder should be deployed with the PowerBuilder runtime DLLs from the same version. If the development computer is updated with a new build, PowerBuilder .NET applications and components must be rebuilt and redeployed with the new runtime files.
1.5 Migrating PowerBuilder Extension applications
Import the PowerBuilder extension file (pbXXX###.pbx, where XXX is an abbreviation used for the extension type, and ### stands for the current PowerBuilder version) into your migrated PowerBuilder project, then do a full build before deploying the application.
2.1 RTF and Images in the DataWindow Object
PowerBuilder 12.5 introduces the RTF, Image, and XPS Database Blobs, as well as RichText and RichTextFile expression functions for Computed Fields.
The RTF, Image, and XPS Database Blob feature is a port of the existing feature from PowerBuilder .NET.
The RichText expression function takes as argument a string expression interpreted as RTF file and renders it as such. If the argument is not RTF, nothing renders.
The RichTextFile takes as argument a string expression interpretation of the name of the RTF file and renders it as such. If the argument is not an RTF file, nothing renders.
2.2 User-Drawn Controls in DataWindow Objects
The Paint (expr) expression functions allow you to draw objects in the DataWindow such as polygons, arrow tips, pie slices, and so on.
The Paint expression function takes one string expression argument and returns the same string. This allows you to paint inside a DataWindow in a way that respects the position and z-order of other DataWindow objects. It should contain a function call to a drawing global function with rendering logic. If expr is a string expression and the value is not null, the Computed Field will render the evaluated string expression.
This feature also provides the following supporting functions:
2.3 Window Control transparent Value and transparency property
PowerBuilder 12.5 introduces two new features for window controls:
- transparent value for window control BackColor
- transparency property for window control
The following controls support the new value and property:
2.4 Support for New ASE 15.5 Datatypes (IM)
PowerBuilder and InfoMaker supports the new datatypes in ASE 15.5: BIGTIME and BIGDATETIME.
- BIGTIME: Includes the hour, minute, second, and fraction of a second. The fraction is stored to six decimal places.
- BIGDATETIME: Includes the year, month, day, hour, minute, second, and fraction of a second. The fraction is stored to six decimal places.
2.5 Sharing Datasources with .NET
New support is added for sharing ADO.NET connections. PowerBuilder 12.5 provides the ability to share ADO.NET connections between PowerBuilder (Win32) and third-party .NET assemblies exposed in COM. A PowerBuilder native application provides the capability to import an ADO.NET connection from a third-party .NET assembly and to export an ADO.NET connection to a third-party assembly. This feature already exists in PowerBuilder.NET, but the PowerBuilder Classic IDE supports a native version of this feature using .NET COM Interop. Two methods have been added to the PowerBuilder Transaction NVO:
- bool SetAdoConnection(oleobject connectionProxy) Imports an external ADO.NET connection.
- oleobject GetAdoConnection() Exports an ADO.NET connection from a connected PB Transaction instance.
You can invoke these two method to get or set the proxy to share an ADO.NET DB Connection between a PB app and third-party .NET assembly.
2.6 AutoWidth Property (IM)
In the Grid presentation style report, the AutoWidth property allows you to choose the option to automatically compute the width of a column. The AutoWidth property takes one of these numeric values:
- 0 - No AutoWidth: This is the default value.
- 1 - AutoWidth is computed for visible rows (monotonic) and does not decrease when the widest column is reduced when scrolling.
- 2 - AutoWidth is computed for visible rows (non-monotonic)
- 3 - AutoWidth is computed for all retrieved rows.
You can set the AutoWidth property:
- In the painter - in the Properties view, select one of the values in the drop-down list for the AutoWidth property.
- In scripts - set the AutoWidth property to one of the numeric values.
2.7 Support for Tab Sequence, Enabled, and Show Focus Rectangle Properties
These properties are supported in the PowerBuilder Classic DataWindow. PowerBuilder .NET WPF DataWindow supports only Tab Sequence and Enabled.
The Tab Sequence property is not expressionable, but Enabled and Show Focus Rectangle are.
- The default value of Tab Sequence is zero for all non-column controls, replicating the previous behavior. You can edit it as needed.
- The default value for the Enabled property is "yes."
- The default value of the Show Focus Rectangle property is "no."
The Show Focus Rectangle property is supported only in PowerBuilder Classic.
The following DataWindow controls now have the Tab Sequence, Enabled, and Show Focus Rectangle properties:
- Button (Show Focus Rectangle does not apply)
- Computed Field
The Column control does not have the Enabled property because it has existing mechanisms which achieve the same effect.
PowerBuilder Classic supports these properties for OLE Objects and OLE Database Blobs.
3.1 ASE 15.5 Support (IM)
In PowerBuilder and InfoMaker 12.1, you can access Adaptive Server Enterprise 15.5. However, no support for new ASE 15.5 features is added.
3.2 Sql Anywhere 12.0 support (IM)
In PowerBuilder and InfoMaker 12.1, you can access SQL Anywhere version 12.0. However, no support for new SQL Anywhere features is added.
3.3 HasMinHeight Property
PowerBuilder Classic 12.1 has a new height property and a new height expression function for the DataWindow object. This property is only supported in PowerBuilder Native. It is not supported in Windows Forms, Web Forms, or PowerBuilder .NET. HasMinHeight only applies to columns that have Autosize enabled.
When both Autosize height and HasMinHeight are true, the height value will be the max value between the auto height value (the calculated value when the Autosize height is set to true) and the value specified in the Height property.
dw_1.object.fname.Height.HasMinHeight = "no"
dw_1.object.compute_1.Height.HasMinHeight = "yes"
dw_1.object.t_1.Height.HasMinHeight = "no"
3.4 FontHeight Function
PowerBuilder Classic 12.1 has a new height expression function for the DataWindow object. This function is only supported in PowerBuilder Native. It is not supported in Windows Forms, Web Forms, or PowerBuilder .NET.
The new DataWindow expression function FontHeight allows you to find the height of the font for a column or computed field. This function takes the column name as an argument. Use this function to set the minimum height to the size of the font.
dw_1.object.fname.Height = "0~tFontHeight(fname)"
3.5 Find Function
The DataWindow Find function now has a buffer argument. You can use the new argument to find data in the Delete! or Filter! buffer. The default value is Primary! The argument is optional.
4.1 Deprecated functionality
The ability to build a COM or COM+ component is no longer available. However, you can still connect to COM and COM+ components from standard PowerBuilder client-server applications.
4.2 PowerBuilder Classic and PowerBuilder .NET
PowerBuilder 12.0 installs with two separate IDEs. The familiar PowerBuilder IDE is rebranded as PowerBuilder Classic. The new IDE is called PowerBuilder .NET.
The PowerBuilder Classic IDE retains the same basic functionality as in earlier PowerBuilder releases. The PowerBuilder .NET IDE hosts the Visual Studio isolated shell and is designed for compliance with the common language specifications for .NET.
PowerBuilder .NET includes one new target type (WPF Window Application) and two new project types (WPF Window and WCF Client Proxy). You can migrate PowerBuilder Classic client-server and Windows Forms targets to PowerBuilder .NET using the WPF Window Application target wizard.
The .NET Assembly target type is available in both PowerBuilder Classic and PowerBuilder .NET, but in PowerBuilder .NET, you can take advantage of language enhancements for fuller .NET compliance. You can also migrate .NET Assembly targets from PowerBuilder Classic to PowerBuilder .NET.
For information about PowerBuilder .NET targets and projects, see the PowerBuilder .NET Features Guide.
4.3 Platform support (IM)
PowerBuilder 12.0 adds support for the Windows 7 Professional 32-bit platform, and has also been tested on Windows XP (SP3), Windows XP Tablet PC (SP 3), Windows Server 2003 (SP 2), and Windows Vista (SP 2). PowerBuilder 12.0 maintains support for deployment to Windows Server 2008 (SP 2), but no longer supports deployment to Windows 2000.
4.4 New properties, functions and database parameters
The following new items are documented in the online Help for PowerBuilder 12.0:
- OriginalSize property for buttons and picture controls in DataWindow objects
- Clear (gridFlag) syntax for RichTextEdit controls
- ClearAll function for RichTextEdit controls
- CloseUserObject, OpenUserObject, and OpenUserObjectWithParm functions are supported for visual user objects
- PBAddCookie and PBGetCookies functions for Web Service proxy objects
- Eleven SoapPBCookie methods for getting and setting cookie properties
- Four SoapConnection methods for setting proxy server bypass conditions
- GenerateEqualIsNull database parameter for all database connections
- NCharBind database parameter for SQL Server (SNC) connections
4.5 Enhancements to the Runtime Packager
In PowerBuilder 12.0, the Runtime Packager is enhanced to allow generation of a Microsoft Merge Module (MSM file) instead of an MSI file.
If you select the PowerBuilder .NET Components option, the MSM or MSI file created by the Runtime Packager now includes the runtime files required for applications developed in the new PowerBuilder .NET IDE. However, the installation package you create with the PowerBuilder .NET Components option still includes the runtime files required for .NET applications and components that you develop in the PowerBuilder Classic IDE.
In the Runtime Packager, you can also select an option to include DLL files required for exporting graph or DataWindow data to a file with the Microsoft Excel 2007 format. The Sybase.PowerBuilder.DataWindow.Excel12.dll and PBDWExcel12Interop120.dll files are added to the MSM or MSI file when you select the MS Excel12 Support check box and create an installation package from the Runtime Packager. The Microsoft Excel 2007 format also requires .NET Framework 3.0 or later, but this must be installed separately on the runtime computer, since it is not included in the package generated from the Runtime Packager.
4.6 Enhancements for the ADO.NET Interface
The PowerBuilder 12 ADO interface has been extended to support ADO.NET providers. Now, you can connect at runtime to any data source that adheres to the ADO.NET 2.0 Common Provider model.
|ADO .NET Provider
||Enhancements for the ADO.NET Interface
|ADO.NET for Oracle
||ODP.NET Driver Updates
Drivers for these ODP.NET versions are updated:
- For Oracle 10g, the Oracle.DataAccess.dll driver was upgraded from Version 10.1.0.301 to 22.214.171.124
- For Oracle 11, the Oracle.DataAccess.dll Version 126.96.36.199 driver was added
Both drivers are ADO.NET 2.0 compatible.
The PowerBuilder ADO.NET interface no longer includes a driver for Oracle ODP.NET 9i. Users of that provider should migrate to Oracle ODP.NET 10g.
New Features of ODP.NET 2.0 for Oracle 10.2 and Earlier
New Features for ODP.NET 2.0 for Oracle 11g
- Client Identifier: The client identifier is a predefined attribute for the Oracle application context namespace, USERENV. Like proxy authentication, the client identifier enables tracking user identities. However, unlike proxy authentication, the client identifier does not require separate sessions for the proxy user and end user. Also, the client identifier does not need to be a database user, and can be set to any string. Most important, the client identifier enables ODP.NET developers to use application context and Oracle Label Security, and to configure an Oracle Virtual Private Database (VPD) more easily.
Configure the client identifier for Oracle ADO.NET data providers in the Driver Specific tab of the Database Profile Setup dialog.
- Connection Pool Optimizations for RAC Databases: An Oracle Data Provider for ADO.NET optimizes connection pooling for Real Application Cluster (RAC) databases by balancing work requests across Oracle RAC instances, based on load balancing advisory and service requirements. In addition, the ODP.NET connection pool can be enabled to proactively free resources associated with connections that have been severed when an Oracle RAC service, instance, or node goes down.
Specify ODP.NET connection pool optimizations as arguments to the ProviderString DBParm parameter. You can enter driver-specific parameters at the bottom of the Connection tab of the Database Profile Setup dialog.
- Large Object Retrieval: You can retrieve entire columns of large object (LOB) data even if the select list does not contain a primary key, row id, or unique key. To use this enhancement, set the InitialLOBFetchSize property value to -1 for CLOB and BLOB objects.
- LONG Retrieval: You can retrieve entire columns of LONG and LONGRAW data even if the select list does not contain a primary key, row id, or unique key. To use this enhancement, set the InitialLONGFetchSize property value to -1.
- XMLType: The Oracle XMLType datatype is mapped to the PowerBuilder string type, with these limitations:
- XMLType cannot be used in Where clauses within PowerBuilder Embedded SQL statements or in a DataWindow object.
- XMLType columns cannot be selected directly by an Oracle cursor.
- XMLType cannot be a parameter of a procedure or function, because PowerBuilder binds XMLType as a string type, but Oracle does not support that usage.
- Client Access Through a Proxy: With proxy authentication, the end user typically authenticates to a middle tier (such as a firewall), that in turn logs into the database on the user's behalf, as a proxy user. After logging into the database, the proxy user can switch to the end user's identity and perform operations using the authorization accorded to that user.
The Connection tab of the Database Profile Setup dialog provides a Connect As dropdown control. To create a proxy connection, enter a different value that is not one of the predefined control items (Default, SYSOPER, and SYSDBA).
- Transparent Application Failover Notification: Transparent Application Failover (TAF) notification enables an application connection to automatically reconnect to another database instance if the connection is severed. When a failover occurs, applications may wish to be notified.
A new DBParm, SvrFailover, supports TAF notification. By default, SvrFailover is set to 0. If SvrFailover is set to 1 (true or yes), the transaction object invokes the DBNotification event when a failover occurs.
The following ADO.NET 1.1 features are not supported:
- ODP.NET Configuration: Developers can now configure ODP.NET using configuration files, including the .NET application configuration file, web.config, and machine.config. Settings in the machine.config file override the registry settings. The settings in the application configuration file or the web.config file overrides the values in the machine.config file.
- Additional Connection Pool Optimizations for RAC and Data Guard: ODP.NET now cleans up the connection pool when the database down event is received from Real Application Clusters (RAC) or Oracle Data Guard. This is in addition to the events for which ODP.NET previously cleaned up the connection pool: node down, service member down, and service down.
- Windows-Authenticated User Connection Pooling: You can now manage operating system-authenticated connections as part of ODP.NET connection pools, through Windows account management.
- Connection Pool Performance Counters: ODP.NET publishes performance counters for connection pooling, which can be viewed using the Windows Performance Monitor.
For PowerBuilder, the counters can be set in the Windows registry or in the application configuration file.
- Oracle User-Defined Types: PowerBuilder does not support UDT types.
- Bulk Copy Operations: ADO.NET 1.1 enables applications to efficiently load large amounts of data from a table in one database to another table in the same or a different database.
PowerBuilder does not support bulk copies; instead it uses pipelines for table copy operations.
|ADO.NET for Adaptive Server Enterprise
||Drivers for these ADO.NET versions are updated:
- The ASE 12.5x ADO.NET driver, Sybase.Data.AseClient.dll, is updated from Version 1.1.411.0 to 1.1.670.0.
The ASE 12.5x ADO.NET driver is ADO.NET 1.1 compatible, and does not support ADO.NET 2.0.
- The ASE 15 ADO.NET driver is updated from Sybase.Data.AseClient.dll Version 188.8.131.52 to Sybase.AdoNet2.AseClient.dll 1.15.325.0.
The ASE 15 ADO.NET driver is ADO.NET 2.0 compatible.
New Features for ASE 15
The ASE 15 ADO.NET driver supports these new ASE identity types:
- Bigint identity
- Int identity
- SmallInt identity
- Tinyint identity
- unsigned bigint identity
- unsigned int identity
- unsigned smallint identity
|ADO.NET for Microsoft SQL Server
||New Features for SQL Server 2005 and Earlier
- Large value types:
xml, varchar(max) and nvarchar(max) are mapped to the PowerBuilder string type; varbinary(max) is mapped to the PowerBuilder blob type.
- PowerBuilder supports SQL Server database mirroring, and a DBNotification event is fired when failover occurs.
A new DBParm parameter, FailoverPartner, enables you to set the SQL Server failover partner server, as in the SQL Native Client (SNC) interface
Query notifications are not supported by the PowerBuilder ADO interface for SQL Server.
New Features for SQL Server 2008
The following SQL Server 2008 features are supported:
These SQL Server 2008 featues are not supported:
- New datatypes:
The SQL Server date, time and datetime2 datatypes are mapped to PowerBuilder date, time and datetime types. varbinary(max) (filestream ) is mapped to the PowerBuilder blob type. The maximum scale of time or datetime2 is 6.
- The new T-SQL commands support:
- MERGE statement
- Grouping sets
- Row constructors
- Table hints
- The new T-SQL command works in the PowerBuilder ADO interface for SQL Server, as in the SNC interface.
- datetimeoffset datatype
- Table-valued parameters
|ADO.NET for SQL Anywhere
||Connect to a SQL Anywhere database using an iAnywhere.Data.SQLAnywhere provider. PowerBuilder applications can perform all database related operations, such as exploring SQL Anywhere database objects like tables and procedures, and retrieving and updating data in the Database Painter.
|ADO.NET for Informix
||PowerBuilder supports DB2 using the System.Data.Odbc provider for both runtime and design time operations.
The Informix DATETIME HOUR TO SECOND type is treated as type TIME in PowerBuilder. Also, the TIME type column is displayed in the Database Painter as DATETIME, because the two variants of Informix DATETIME type are indistinguishable in the resultset schema.
The IBM.Data.Informix driver does not support the BindSPInput dbparm.
|ADO.NET for DB2
||PowerBuilder supports DB2 using the System.Data.Odbc provider for both runtime and design time operations.
5.1 Deployment support for the Windows 2000 platform (IM)
Due to customer request, PowerBuilder 11.5.1 includes deployment and runtime support for the Windows 2000 platform that was previously discontinued with the PowerBuilder 11.5 release. However, Windows 2000 is not supported as a development platform, and runtime support may be removed in future releases of PowerBuilder.
5.2 JDK 1.6 Support (IM)
PowerBuilder 11.5.1 applications and components include support for JDK1.6_02, that you can optionally install with the Sybase EAServer 6.2 setup program.
5.3 FIPS 140-2 certification (IM)
The PowerBuilder 11.5.1 development environment meets the encryption requirements of the Federal Information Processing Standard (FIPS) as outlined in Publication 140-2 of the United States government's National Institute of Standards and Technology. To meet these standards, PowerBuilder embeds the Certicom 5.x cryptographic modules. Support is certified for the PowerBuilder development environment only, not for runtime applications that are built with PowerBuilder. The FIPS 140-2 standard requires that passwords be encrypted. The PowerBuilder 11.5.1 user interface displays all passwords as strings of asterisks. Some files with passwords, such as database profiles, that you export from PowerBuilder 11.5.1, cannot be correctly imported into earlier versions of PowerBuilder because of the enhanced password protection. However you can still import files containing unencrypted passwords from earlier versions of PowerBuilder. When you save these files in—or export them from— PowerBuilder 11.5.1, the passwords are encrypted using a FIPS compatible method.
5.4 Support for Microsoft Office 2007 Excel formats (IM)
PowerBuilder 11.5.1 you can also save DataWindow and graph data in .XLSX and .XLSB (Excel12) format, with or without column headers. Because .NET Framework 3.0 or later must be installed on development and runtime computers to use this functionality, you cannot save data in these formats on Windows 2000 computers.
Other than the Windows 2000 platform restriction, the same level of support is provided as for Microsoft Office 2003. You can use the PowerScript SaveAs command with graphs or DataWindow controls to save data to Excel 2007 formats by setting the saveastype argument to XLSX! or XLSB! You can also export DataWindow data to Excel 2007 formats by selecting one of the Excel12 items from the drop-down list in the Save As dialog box that displays when you select the Save Rows As menu item in the DataWindow painter.
Excel 2007 support is dependent on the following strongly named assemblies:
- Sybase.PowerBuilder.DataWindow.Excel12.dll This assembly is installed in the GAC.
- PBDWExcel12Interop115.dll This assembly is installed in the Sybase/Shared/PowerBuilder directory.
These DLLs are deployed by the Runtime Packager when you select the MS Excel12 Support check box.
5.5 Support for SQL Anywhere 11.0 mirroring (IM)
PowerBuilder 11.5.1 allows you to take advantage of SQL Anywhere 11.0 database mirroring. Database mirroring is a configuration of either two or three database servers that cooperate to maintain copies of database and transaction log files. If the primary server becomes unavailable because of hardware or software failure, the mirror server negotiates with the SQL Anywhere arbiter server to take ownership of the database and assume the role of primary server.
5.6 Informix 11.5 Support (IM)
PowerBuilder 11.5.1 applications and components work correctly with the Informix 11.5 DBMS through the I10 interface, although new Informix 11.5 features are not supported in this release. You can use the 110 Informix v10.x database driver to connect to the Informix 11.5 DBMS, but this also requires that you upgrade the Informix client from Informix SDK 2.9 to Informix SDK 3.5.
5.7 Microsoft SQL Server 2008 support (IM)
PowerBuilder 11.5 included support for many of the new SQL Server 2008 features, but the released SQL Server product was not available for complete testing before the PowerBuilder release date. However, these features have been tested with PowerBuilder 11.5.1. They are described in the New Features Guide for PowerBuilder 11.5, and in the online Help.
6.1 Directory changes for FDCC compliance (IM)
The Federal Desktop Core Configuration (FDCC) is a security standard mandated by the US Office of Management and Budget (OMB). Although most PowerBuilder files install by default to Program Files\Sybase subdirectories, write access to these subdirectories is typically restricted to administrative users. Therefore, to meet the FDCC requirements, in PowerBuilder 11.5 and later, all writable files are installed, copied, or created in directories where standard users have write access.
6.1.1 FDCC constraints on certain PowerBuilder features (IM)
Several PowerBuilder features might still require write access to Program Files\Sybase subdirectories, or require the ability to add a system printer. For example, to save a DataWindow to a PDF file, you must first copy the PSCRIPT.DLL, PSCRIPT.NTF, and PS5UI.DLL files to the Program Files\Sybase\Shared\PowerBuilder\drivers directory, and you must install the Sybase Datawindow PS printer. This must be done by an administrator before a standard user can save a DataWindow to a PDF file.
When using remote debugging on an FDCC-configured desktop with the Windows Firewall set to on, the connection to the server fails if pb115.exe is not included in the list of firewall exceptions at the domain level. To use remote debugging under these circumstances, you must add pb115.exe to (or select PowerBuilder 11.5 from the program list for) the list of domain-level firewall exceptions.
Other writable files are installed in the default Program Files\Sybase subdirectories, but are copied to different locations the first time a user starts PowerBuilder or InfoMaker. In this way, each PowerBuilder or InfoMaker user gets a private copy of these files.
Table 1 lists the files that are copied and updated in the directories of all users who run an instance of PowerBuilder or InfoMaker. The path variable in the table header (UserName) stands for the user name of a PowerBuilder or InfoMaker user. For Windows XP and 2003, this is under the C:\Documents and Settings directory. For Windows Vista and 2008, this is under the C:\Users directory.
The locations of writable PowerBuilder files reserved for individual use are set in HKEY_CURRENT_USER registry entries for each PowerBuilder user. For example, the location of the PB.INI file that is copied to each user's local application data directory is registered under the registry key HKEY_CURRENT_USER\Sybase\ PowerBuilder\11.5\InitPath.
The AJAX enhancement for Web Forms applications does not require any changes in the PowerBuilder IDE, and you do not need to alter your PowerScript code to use the AJAX feature. However, PowerBuilder cannot deploy a Web Forms application unless AJAX is installed on the Web server. You can download and install the Microsoft ASP.NET AJAX Extensions version 1.0 on both the development and deployment computers from the ASP.NET Web site at http://www.asp.net/ajax/downloads/archive.
PowerBuilder 11.2 uses Telerik RadControls for menus, toolbars, and other controls in Web Forms applications by default. Although not recommended, you can use IE Web Controls instead of the RadControls, but you must change the PBWebControlSource global property for your application and install the IE Web Controls on the server.
If you must use IE Web Controls, you need to download IE Web Controls from the Microsoft Web site at http://www.asp.net/IEWebControls/Download.aspx and install the controls on the Web server. After you install the controls, you must set the PBWebControlSource selection to “IE”, either on the Configuration tab of the Project painter before you deploy your application, or in the Web.config file after you deploy your application.
One of the most significant changes in Windows Vista is the introduction of User Account Control (UAC). UAC is the mechanism Vista uses to limit the default privileges users run with on Vista. Limiting these privileges is intended to make it less likely that a user’s actions affect the configuration of the system or other users’ state and settings.
PowerBuilder typically writes to multiple files in the Program Files directory, including pb.ini, PB110_sysam.properties, and code examples, tutorial, and demo database files. If an application is run without administrative privileges, Vista restricts it from writing to the HKEY_LOCAL_MACHINE subtree in the registry, the Program Files directory, and the Windows directory. Instead, changes are written to a writable area in the registry and to the user’s local directory. This is referred to as virtualization.
For example, if you start PowerBuilder without administrative privileges, the pb.ini file is written to Program Files\Sybase\PowerBuilder 11.0\pb.ini in the C:\Users\<your_name>\AppData\VirtualStore directory.
To avoid the issues that would result from this behavior, on Vista, you must start PowerBuilder 11.1 with administrative privileges by right-clicking pb110.exe in the Start menu or Explorer and selecting Run as administrator from its pop-up menu.
When you run an application on Vista, Vista warns you if the application uses any DLLs that have not been signed with an Authenticode certificate. If you want to deploy your application with Windows Vista Logo certification, all the DLLs that you distribute with it must be signed. PowerBuilder runtime DLLs, and all other PowerBuilder DLLs, are signed.
8.1.3 IIS 6 compatibility component requirement for Web Forms on IIS 7 (Vista)
If you deploy a Web Forms application to a remote server running IIS 7, or if you publish a smart client application to a local or remote server running IIS 7, the Vista Metabase Compatibility component of IIS 7 must be installed on the server. This component is not installed by default. It is not required to deploy a Web Forms application to a local server.
You can install it from the Programs and Features page in the Windows control panel. Select Turn Windows features on or off, then select Internet Information Services>Web Management Tools>IIS 6 Management Compatibility>IIS Metabase and IIS 6 configuration compatibility.
8.1.4 Permission requirements for Web Forms applications on IIS 7 (Vista)
When you deploy a new Web Forms target, a temp directory is created in the Inetpub\wwwroot\application_name directory, where application_name is the name of your application, and several subdirectories are created in the Inetpub\wwwroot\application_name_root directory. Files are written to and deleted from these directories, therefore the IIS_IUSRS group must have full permissions on temp and application_name_root.
Before a PowerBuilder .NET Web Forms application connects to a SQL Anywhere database, you must either start the database manually or grant the IIS_IUSRS group on IIS 7 default permissions for the Sybase\Shared and Sybase\SQL Anywhere directories, making sure to replace permissions of all child objects in those directories. Full permissions are required for the database and database log files used by your application.
If you do not grant the appropriate user permissions for Sybase directories and your database configuration is set to start the database automatically, your application will fail to connect to the database. SQL Anywhere cannot access files unless the IIS_IUSRS user group has the right to access them.
8.1.5 Some calendar properties are not supported on Vista (IM)
The Vista operating system does not support several properties for the DatePicker, EditMask, and MonthCalendar controls and the drop-down calendar in a DataWindow column. The following properties are not supported on Vista:
- DatePicker properties: CalendarBackColor, CalendarFontName, CalendarFontWeight, CalendarItalic, CalendarTextColor, CalendarTextSize, CalendarTitleBackColor, CalendarTitleTextColor, CalendarTrailingTextColor, CalendarUnderLine
- EditMask properties: CalendarBackColor, CalendarTextColor, CalendarTitleBackColor, CalendarTitleTextColor, CalendarTrailingTextColor
- MonthCalendar properties: FaceName, MonthBackColor, TextColor, TextSize, TitleBackColor, TitleTextColor, TrailingTextColor, Underline
- Properties for column controls in DataWindow objects with a drop-down calendar EditMask style: DDCal_BackColor, DDCal_TextColor, DDCal_TitleBackColor, DDCal_TitleTextColor, DDCal_TrailingTextColor
In addition, the Vista operating system does not support the WeekNumbers property for the DatePicker control. When this property is true, the DatePicker control is not displayed correctly. The same limitation applies to the MonthCalendar control when WeekNumbers is true and Autosize is false.
8.1.6 JSP targets are not supported on Vista
On the Vista operating system, you can create a JSP target and a JSP page, but the component used to implement the HTML Editor’s Page view and its built-in Script editor is not supported on the Vista operating system, therefore JSP targets are not supported on Vista.
9.1 Migrating EAServer targets
In PowerBuilder 11, the EAServer Component target wizard creates a specialized EAServer target instead of an Application target. After you migrate an existing EAServer target to PowerBuilder 11, you cannot start the remote debugger to debug the target unless you open the Project painter and select the Debug menu or toolbar item, or select Debug from the project’s pop-up menu in the System Tree. To ensure that your target behaves correctly, you should use the EAServer Component target wizard to create a new EAServer target, select “Use an existing library and EAServer component project” in the wizard, and select your migrated library and component.
10.1 Toolbar changes in PowerBuilder 10.5
In the Menu painter, you can now add a toolbar to a standalone main window as well as to an MDI frame. PowerBuilder adjusts the size of the main window to accommodate the toolbar. If your application currently uses a visual user object as a toolbar in a main window, the adjustments that PowerBuilder makes might affect the display of your toolbar and conflict with adjustments that your scripts make to display microhelp.
You can replace your toolbar user object with a toolbar designed in the Menu painter or continue to use your existing toolbar. To ensure that your existing toolbar displays correctly, set the window’s ToolbarVisible property to false in a script or on the Toolbar page in the Properties view. To avoid conflicts, you should also move any microhelp position adjustment code into an event that runs after the Open event of the window.
10.2 Icon changes in PowerBuilder 10.5 (IM)
In PowerBuilder 10.5, many of the icons used in the PowerBuilder and InfoMaker user interfaces were changed. When you migrate an application to PowerBuilder 10.5, any stock icons used in the application are updated automatically. For users who prefer to use the existing icons, a zip file that contains 24 icon files and more than 500 bitmap files used in previous versions of the products is available on the CodeXchange Web site.
10.3 Migrating components to EAServer 6.0.1 or later
Intercomponent calls from a PowerBuilder component running in EAServer 6.0.1 require proxies for all called components. With earlier versions of EAServer, a PowerBuilder component is sometimes able to call another PowerBuilder component running in the same server without the use of a proxy, because the PowerBuilder VM creates a proxy for the component dynamically using method names that match the names of the component's methods.
In EAServer 6.0.1 and later, PowerBuilder components are wrapped as EJBs, providing an extra layer of security and preventing the PowerBuilder VM from generating a proxy with names that match the component's method names dynamically. Therefore, you must create a proxy object for all components you invoke with intercomponent calls. Without a proxy object, the TransactionServer object cannot obtain the correct method names of the component you are calling.
10.4 Creating an EJB client application for EAServer 6.x
Building EJB client applications for EJBs running in EAServer 6.x requires you to take some additional steps when you create the EJB client proxy and when you create the client.
To generate a proxy for an EJB deployed to EAServer 6.x:
- Copy the packagename directory from the %DJC_HOME%\deploy\ejbjars\ directory on the server to the client computer, where packagename is the package that contains the EJB you want to use.
- Add this directory to the Classpath on the Select EJB Component dialog box in the EJB Proxy Project painter.
- Generate the proxy.
To create an EJB client application for an EJB deployed to EAServer 6.x:
- Copy the eas-server-14.jar file (or eas-server-15.jar if you are using JDK 1.5.x) from the %DJC_HOME%\lib directory to the client computer and include its full path in the client’s classpath.
- Copy the stub files from %DJC_HOME%\genfiles\java\classes\ directory to the client computer and include this path in the client’s classpath.
- Copy the packagename directory from the %DJC_HOME%\deploy\ejbjars\ directory on the server to the client computer, where packagename is the package that contains the EJB you want to use and include this path in the client’s classpath.
If you copied these files and directories to a directory on the client called EAServer6, and you want to use an EJB in the datamapping package, the client classpath setting might look like this:
10.5 PowerBuilder system types as variable names in proxies
In PowerBuilder 10.5 and later versions, system types cannot be used as variable names in Web service proxies. If a PowerBuilder system type is used as a variable name, the Web Service Proxy wizard renames the variable by applying the prefix ws_. If you are migrating Web service applications from PowerBuilder 10.2 or earlier and regenerating the Web service proxies in PowerBuilder 10.5 or later, your code may need to be modified to reflect the change in variable names.
PowerBuilder system types include not only the objects and controls listed on the System tab page in the PowerBuilder Browser, but also the enumerated types listed on the Enumerated page in the Browser, such as band, button, encoding, location, and weekday. For example, if you build a Web service from a PowerBuilder custom class user object, and one of its functions has a string argument named location, in the proxy generated for that Web service, the argument is changed to string ws_location.
10.6 OLE DB performance with Microsoft SQL Server
In PowerBuilder 10.5.2 and later, when you use the OLE DB database interface with a Microsoft SQL Server database and retrieve data into a DataWindow or use an embedded SQL cursor in a SELECT statement, server-side cursors are used to support multiple command execution. If this has a negative impact on performance, try increasing the size of the Block database parameter to 500 or more, or adding the following line to the [Microsoft SQL Server] section in the PBODB initialization file to turn off server-side cursors:
ServerCursor = 'NO'
10.7 Change in behavior of OpenTab
A change was made in PowerBuilder 10.2.1 Build 9716, PowerBuilder 10.5.1 Build 6505, and PowerBuilder 11.0 Build 5021, to correct an anomalous behavior when the SelectedTab property was applied at runtime to a tab whose Visible property was set to false.
As a result of this change, there is a change in the behavior of the OpenTab and OpenTabWithParm functions. In previous releases, calling the OpenTab or OpenTabWithParm function to open a user object as a tab page displayed the tab page even if the user object’s Visible property was set to false. In current releases, the user object’s Visible property must be set to true for the tab page to display.
10.8 RichTextEdit control and RichText DataWindow changes (IM)
PowerBuilder 10.5 uses a new rich text editor to support the RichTextEdit control and the RichText DataWindow presentation style. The new editor brings a modern look and includes some new features, including the ability to name and use formatting styles. The new rich text editor supports a subset of the RTF specification version 1.6. Most of the properties and functions of rich text objects in previous versions of PowerBuilder continue to be supported by the new editor. When you import rich text objects from previous versions of PowerBuilder, any obsolete properties and functions are ignored.
There are some differences in behavior that may require you to make some changes in your applications. For example, when you migrate applications created in older versions of PowerBuilder, the InputFieldsVisible property in RichTextEdit controls and in RichText DataWindow objects is automatically set to “false” in the migrated applications. You must set this property to “true” to see data in the input fields. You must set this property and the InputFieldNamesVisible property to “true” to see text labels for the input fields in a rich text control.
For more information about changes, see the section on Rich text enhancements
in the New Features in PowerBuilder 10.5 guide on the Sybase Product Manuals Web site.
10.9 Some PSR files must be regenerated (IM)
PSR files created in builds of PowerBuilder 10.0 or 10.0.1 prior to EBF build 6044 cannot be opened in later builds of PowerBuilder or InfoMaker. You must regenerate the PSR file in a later build.
11. Migrating from PowerBuilder 9 or earlier
11.1 Unicode changes (IM)
PowerBuilder 10 is Unicode enabled. The source code in PowerBuilder 10 PBLs is encoded in UTF-16LE. UTF-16LE is a Unicode encoding scheme that serializes a UTF-16 code unit sequence as a byte sequence in little-endian format, in which multiple-byte numerical values are stored with the least significant byte first. PBLs developed in earlier versions of PowerBuilder contain source code in ANSI or DBCS format. When you migrate applications to PowerBuilder 10, each PBL is first migrated to the new version of PowerBuilder, as in previous releases. Then PowerBuilder converts the source code from ANSI or DBCS to Unicode, performs a full build, and saves the source code back to the same file.
As a result of this change, some new functions have been added and there are changes in the syntax of file-related functions and external function calls. For more information about these changes, see the Unicode support section in the New Features topic in online Help and the section on Unicode in Application Techniques.
11.2 Automatic changes made when you migrate
When you migrate an application from a previous release, the source code is converted to Unicode and the following changes to your source code are made automatically:
The clause ALIAS FOR functionname ;ansi is appended to external function declarations that return a string, char, or structure datatype or have a string, char, or structure value as an argument. This indicates that the arguments and/or return values should be treated as ANSI. If an ALIAS FOR clause is already present, only ;ansi is added. If ;ansi is not appended to the function name, strings are treated as Unicode.
The FromAnsi, FromUnicode, ToAnsi, and ToUnicode functions will be removed from a future version of PowerBuilder. The migration tool replaces them with the appropriate syntax of the Blob or String function.
No changes are made to the code if the PBL has already been migrated to PowerBuilder 10.
In a DBCS environment, you can check the "Automatically convert DBCS string manipulation functions" check box on the Migrate Application dialog box to modify your code to comply with changes required for Unicode support. Do not check this box in an SBCS environment. If you check this box, the W suffix is removed from PowerScript string-manipulation functions such as LenW and RightTrimW, and an A suffix is added to the following PowerScript functions: Fill , Left, Len, Mid, Pos, Replace, and Right. The changes to string-manipulation functions described in the documentation also apply to DataWindow expression functions. However, the migration process does not modify DataWindow expression functions automatically.
11.3 ImportFile size limit
PowerBuilder 10.0 and later versions are Unicode enabled. If your application uses the ImportFile method to import very large text files (approximately 839,000 lines) into a DataWindow or DataStore, ImportFile returns the error code -15. Larger text files could be imported in ANSI versions of PowerBuilder.
11.4 Migrating Web and JSP targets
Web targets that use PowerDynamo cannot be migrated directly to PowerBuilder 10 and must be rewritten using an alternative model such as JavaServer Pages or Active Server Pages. For information about converting PowerDynamo Web sites created using PowerBuilder to JSP, see the Technical Document Converting 4GL Web Pages from PowerDynamo to JSPs
Web and JSP targets that use the Web DataWindow and were created in earlier versions of PowerBuilder must be modified to use the HTMLGenerator100 component. Most other Web and JSP targets can be opened and deployed in PowerBuilder 10 without modification. See Section 7.5, "JSP object model changes"
for an exception. As a precaution, you should make backup copies of the target directories before making modifications.
11.5 JSP object model changes
Global control variables in the JSP object model have been changed to local variables to make JSP pages thread safe. If you want to refer to another control in a server-side event, you must qualify the name of the control with the string "psPage". For example, in previous releases, the following code in a button's ServerAction event sets the context of a single-line edit control:
sle_1.value = "abc";
In PowerBuilder 10 (and PowerBuilder 9 build 7151 and later), use the following statement instead:
psPage.sle_1.value = "abc";
11.6 DBCS text in object properties is not converted correctly (IM)
DBCS applications can be migrated successfully on operating systems with a DBCS-compatible locale. However, on an operating system with an English locale, DBCS characters display as garbage characters when the font property of an object is set to a font that does not support DBCS characters. To work around this issue, change the font to Tahoma after migration. [CR 355908]
11.7 XML string encoding
In PowerBuilder 10, the XML parser cannot parse a string that uses an eight-bit character code such as windows-1253. For example, a string with the following declaration cannot be parsed:
ls_xml += '<?xml version="1.0" encoding="windows-1253"?>'
You must use a Unicode encoding value such as UTF16-LE.
11.8 Runtime errors in EAServer
In PowerBuilder 7, if a runtime exception was raised by a PowerBuilder component running in EAServer, the transaction was rolled back and the exception was thrown back to the client. In PowerBuilder 8, the behavior was changed so that the transaction was committed before the exception was thrown back. In PowerBuilder 10, PowerBuilder 9.0.2, and EBF releases of PowerBuilder 8 and PowerBuilder 9.0.1 dated February 27, 2004 or later, the default behavior has been reverted to the behavior in PowerBuilder 7 and the transaction is rolled back.
In PowerBuilder 10, PowerBuilder 9.0.2, PowerBuilder 9.0.1 EBF Build 7066 and later releases, and PowerBuilder 8.0.4, you can control this behavior using the PBRollbackOnRTError environment variable. When this environment variable is set to 'y', 'yes', or 'true', the transaction is rolled back before the exception is thrown back to the client. [CR 319543]
11.9 Using masks with "as is" characters
You can define a mask that contains "as is" characters that always appear in the control or column. For example, you might define a numeric mask such as Rs0000.00 to represent Indian rupees in a currency column. In PowerBuilder 9.0.1 or later, you cannot enter a plus or minus sign to represent positive or negative numbers in a mask that contains "as is" characters. In previous releases, you could enter a plus or minus sign, but the resulting behavior was inconsistent in DataWindow columns.
The preferred method of creating a currency edit mask is to use the predefined currency(7)] - International mask. You can change the number in parentheses, which is the number of characters in the mask including two decimal places. When you use this mask, PowerBuilder uses the currency symbol and format defined in the regional settings section of the Windows control panel. You can enter negative values in a column that uses a currency mask. [CR 309118]
11.10 Format of WMF files saved from DataWindows changed
In PowerBuilder 9.0, the format of WMF files created by saving a DataWindow object was changed to fix a crash issue. However, the fix removed the header information that allows the WMF file to be viewed in other applications. The format has been changed to restore the header information while preserving the fix. This change is in PowerBuilder 9.0 EBF builds 6096 and greater and in PowerBuilder 9.0.1, 9.0.2, and 10. [CR 292406]
11.11 MTS/COM+ components must be redeployed
Due to changes in the PowerBuilder VM in PowerBuilder 9.0.1, you must redeploy existing components to MTS or COM+ if you want to call them from PowerBuilder 9.0.1 and later clients. If you do not redeploy the components, calls to functions of the TransactionServer and ErrorLogging objects return incorrect values.
11.12 Change in Date function behavior
When you use the Date function with a string argument, PowerBuilder attempts to match the input string to a date format in the regional settings on the computer. In PowerBuilder 10 and later, if a complete match is not found, PowerBuilder attempts a partial match. For example, if you use Date('01-JAN-1900') and PowerBuilder finds the partial match (dd-MMM-yy), PowerBuilder parses the first two numbers of the year and gets 19. The 2-digit year is interpreted as a year between 1930 and 2029, and the date returned is 1/1/2019.
12. Migrating from PowerBuilder 8 or earlier
12.1 Changed format of PSR files (IM)
The format of PSR files created in PowerBuilder was changed in order to improve data integrity for the SaveAsAscii function. As a result, PSR files created in newer builds of PowerBuilder cannot be opened in builds that predate this change. This change was made in PowerBuilder 8.0 build 7063 and PowerBuilder 7.0.3 build 10102.
12.2 Source code control changes
PowerBuilder 8 provided a direct connection to external SCC-compliant source control systems, and additional changes were made in PowerBuilder 9.0. Before migrating a source-controlled project from PowerBuilder 8 or earlier to PowerBuilder 9 or 10, read the chapter on using source control in the PowerBuilder User's Guide.
12.3 ScrollToRow behavior change
The ScrollToRow method triggers the RowFocusChanging and RowFocusChanged events. In PowerBuilder 7, both events occurred after focus changed to the new row. This behavior was changed in PowerBuilder 9 so that RowFocusChanging could be coded to cancel the scroll. However, this change caused both events to be triggered before focus changed to the new row. In PowerBuilder 9.0.1 Build 7136 and later, the RowFocusChanging event is triggered before the scroll occurs, and the RowFocusChanged event is triggered after the scroll occurs. [CR 345104]
12.4 Web ActiveX deployment requirements (IM)
Microsoft stopped shipping the Microsoft Java VM as of the Windows XP SP 1a release and the Windows 2000 SP 4 release, and the Microsoft Java VM is not supported in PowerBuilder 9 or later. If you use the DataWindow Web control for ActiveX and your Web page uses a JDBC connection, the Web ActiveX has additional deployment requirements:
The Sun JRE 1.2 or later must be installed on the client. Users can download the latest version of the JRE from the Sun Java Web site
The path to the file jvm.dll (...\JRE\bin\client for JRE 1.4 or later and ...\JRE\bin\classic for JRE 1.2 or 1.3) must be added to each user's system PATH environment variable.
The following files must be in a directory in the client's system PATH environment variable: pbjvm90.dll, pbvm90.dll, and libjcc.dll for PowerBuilder 9, or pbjvmXXX.dll and pbshrXXX.dll for later versions.
The pbjdbc12XXX.jar file, which contains class files required by the Web ActiveX, must be deployed to the client. You can deploy the JAR file by referencing it in the CODEBASE attribute of the Object element in your Web page.
Java classes required by your database vendor's client layer must be available on the client. They can be added to a CAB file that is referenced in the CODEBASE attribute of the Object element in your Web page. For example, if you are using Sybase jConnect to connect to a database, the jconn2.jar file should be included in the CAB file. If the client layer is provided in a JAR file, it can be referenced directly in the CODEBASE attribute.
13. Migrating from PowerBuilder 7 or earlier
13.1 Adding targets to a workspace
To add a target to your workspace that uses an application built in PowerBuilder 7 or earlier, use the Existing Application Target wizard on the Target page of the New dialog box. After you complete the wizard, the Migrate Application dialog box opens, allowing you to migrate the application to PowerBuilder 10. For information about using workspaces and targets, see Chapter 1 in the User's Guide.
13.2 Distributed PowerBuilder is not supported
PowerBuilder 7 was the last version of PowerBuilder that incorporated distributed PowerBuilder functionality. Sybase recommended the use of EAServer in place of distributed PowerBuilder for distributed and Web applications in PowerBuilder 7 and later.
The Transport object and its associated properties and methods are obsolete in PowerBuilder 8 and later and were removed from PowerBuilder 9. Additional properties and methods that were used for distributed PowerBuilder and are therefore obsolete include:
- ConnectionBegin and ConnectionEnd events on the Application object
- GetServerInfo, RemoteStopConnection, and RemoteStopListening functions on the Connection object
- SetConnect function for proxy objects
- ConnectString and Trace properties on the Connection object
- ConnectionInfo structure
The JavaBeans Proxy and Web.PB generators were also used with distributed PowerBuilder applications and were removed from the New dialog box.
13.3 Reserved words
New reserved words were added to the PowerScript language in PowerBuilder 8 to support exception handling. If you use any of the new reserved words ( TRY, CATCH, FINALLY , THROW, and THROWS ) as identifiers in existing applications, you must change these identifiers, giving them nonconflicting names. You can run the Migration Assistant, available on the Tool tab page in the New dialog box, to locate incorrect use of the new reserved words.
13.4 SystemError event change
In PowerBuilder 7 or earlier, if an error occurs that is not caught by an Error or ExternalException event, the application's SystemError event is triggered immediately. If there is no code associated with the SystemError event, the application is terminated. Otherwise, after the SystemError event executes, control returns to the location in the code where the error occurred.
In PowerBuilder 8 and later, if an error occurs that is not caught by the exception handling mechanism or by an Error or ExternalException event, the script terminates and the call stack is unwound. If the error occurs as the result of a Triggerevent call in a script, the calling script terminates and the call stack is unwound. In most cases, the SystemError event is not triggered until the call stack becomes empty. If an event of a response window caused the error, the SystemError event is triggered as soon as the response window event completes.
Because of this change in behavior, code that follows the statement that caused the error is not executed after the SystemError event is fired, as it would have been in previous releases. This change has a major impact on applications that rely on the previous behavior of returning control to the script where the error occurred. Code that relies on this behavior must be modified in PowerBuilder 8 and later.
You can handle potential errors by wrapping code that might cause an error in a try-catch block to prevent the SystemError event from being triggered when an execution error occurs. It is still advisable to code the SystemError event to handle any uncaught exceptions. You should not allow the application to continue after the SystemError event is invoked. The SystemError event should clean up and halt the application.
13.5 IsValid function change
The IsValid function now returns false if passed an argument of type Any that cannot be converted to a PowerObject. In PowerBuilder 7 and earlier, passing an invalid object to IsValid caused a system error. You should also take note of the SystemError event change described in the previous section.
13.6 Format for color options changed (IM)
You can specify custom colors for each component of graphical table representations in the Database or SQL Select painter by selecting Design>Options>Object Colors. The colors you specify are saved in your PB.INI file in the [Database] section. The format in which these colors are stored changed in PowerBuilder 8 and later to support the increased number of Windows system colors and custom colors available for controls. For example, these are color definitions for lines representing keys in a PowerBuilder 7 PB.INI:
ForeignKeyLineColor=0 0 255
IndexKeyLineColor=255 0 0
PrimaryKeyLineColor=0 128 0
These are the corresponding entries in a PowerBuilder 8 or later PB.INI:
If you plan to use your PowerBuilder 7 PB.INI file, or the [Database] section from it, with PowerBuilder 8 or later, you should first delete all the color settings in the [Database] section. If you do not, the colors used might make tables unreadable in PowerBuilder 8 or later. You can reset custom colors in the Object Colors page of the Database Preferences dialog box in PowerBuilder 8 or later.
13.7 Web DataWindow migration issues
You might have used workarounds to solve problems with Netscape rendering in releases prior to PowerBuilder 7.0.2 C3. Some of these workarounds might not work correctly in later releases because of improvements to Netscape rendering.
Specifically, if you used computed fields or text fields containing only spaces, the Web DataWindow generator now creates a table entry for these fields, making the table display twice as wide. If you see this behavior, delete these placeholder fields and use a more standard layout.
13.8 DataWindow method return values for empty DataObject property
In PowerBuilder 8.0.2 and later, the value returned when there is no DataWindow object assigned to a DataWindow control or DataStore has been standardized for the methods listed in Table 2. Some of these return values are different from the values returned in PowerBuilder 7 and earlier releases. SetFilter is included in the table, but its return value was changed from 1 to -1 in PowerBuilder 8.0.4, not PowerBuilder 8.0.2.
Table 2: Return values when no DataWindow object is assigned
|GetItemDate, GetItemDateTime, GetItemTime,
GetItemDecimal, GetItemNumber, GetItemStatus
13.9 ScrollNextRow and ScrollPriorRow behavior change
In PowerBuilder 8 and later, the DataWindow methods ScrollNextRow and ScrollPriorRow trigger these events in the order shown:
In PowerBuilder 7 and earlier, the ScrollVertical event was triggered before the other events. You should no longer use these methods in the ScrollVertical event. Doing so causes the same series of events to be triggered repeatedly until the last or first row in the DataWindow is reached. [CR 323263]
13.10 Changed behavior of OpenSheet functions
In PowerBuilder 8 and later, the OpenSheet and OpenSheetWithParm functions might throw a runtime error on failure instead of returning -1. For example, this occurs when the optional windowtype argument is invalid. To ensure that this error is trapped, wrap the call in a try-catch statement in addition to checking the return value:
li_ret = OpenSheet(w_child, "w_child_1", MDI_User, 2, Original!)
if li_ret <> 1 then MessageBox("OpenSheet failed", "Check arguments")
catch (RuntimeError rt)
MessageBox("OpenSheet failed", rt.GetMessage() )
// Handle error
14. Migrating from PowerBuilder 6.5 or earlier
14.1 Nested reports in DataWindow objects renamed (IM)
In PowerBuilder 7 and later, every object in a DataWindow object must have a name. During migration, objects without names are assigned names based on the user-definable prefix settings, usually dw_1, dw_2, and so on. Since names are assigned sequentially, an object might be assigned a name already used by another object in the DataWindow object. This can cause unexpected behavior. For example, naming an unnamed report with a name already used for another DataWindow object, such as dw_2, could cause a GetChild/ShareData or Retrieve operation to find and use the wrong DataWindow object.
To work around this problem, select Design>Options in the DataWindow painter and modify the DataWindow object prefix on the Prefixes tab before migrating. After you migrate the DataWindow object, you can change the prefix back.
14.2 Icons for windows must be assigned
A window no longer inherits its icon from the application that contains the window. To use the application icon, you must explicitly assign it to the window after migration using the new enumerated value AppIcon!.
14.3 ListView and TreeView controls events changed
PowerBuilder 7 and later use Microsoft ListView and TreeView controls. As a result, you might see some changes in behavior that require you to remap some events. When you perform mouse actions, some events do not fire, and some fire in a different order from previous releases.
In PowerBuilder 7 and later, the pbm_rbuttonup event does not fire, but is immediately followed by a pbm_tvnrclicked event (the stock RightClicked! event for a TreeView). Therefore, you can copy any code from pbm_rbuttonup to RightClicked! or have the RightClicked! event trigger whatever code exists in the pbm_rbuttonup. In PowerBuilder 6 both pbm_rbuttonup and pbm_tvnrclicked fire.
Additionally, in PowerBuilder 7 and later, using the right mouse button to select a previously unselected TreeView item causes the previous TreeView item to regain focus when the button is released. In PowerBuilder 6, using the right mouse button to select a TreeView item causes it to become permanently selected. To duplicate this behavior in PowerBuilder 7 and later, place the line of code this.SelectItem(handle)
in the RightClicked! event of the TreeView before triggering (or otherwise executing) code from the pbm_rbuttonup event.
In PowerBuilder 7 and later, the pbm_tvnrdoubleclick event (the stock RightDoubleClicked! event) does not fire but is immediately preceded by a pbm_rbuttondblclk event. Therefore, you can copy any code from the RightDoubleClicked! event to the pbm_rbuttondblclk event or have the pbm_rbuttondblclk event trigger existing code in the RightDoubleClicked! event. Both events fire in PowerBuilder 6.
In PowerBuilder 7 and later, the pbm_rbuttonup event does not fire if you use right-click on a specific ListView item, but it does fire if you right-click in the white area of the ListView where there are no items. A new event, pbm_contextmenu, always fires when the right mouse button is released. Table 3 shows when events are fired in PowerBuilder 7 and later.
Table 3: Events fired in ListView
|On an item in a ListView
||Press right mouse button
||Release right mouse button
||pbm_lvnrclicked (the stock RightClicked! event)
|On an empty area of the ListView
||Press right mouse button
pbm_lvnrclicked (the stock RightClicked!event)
||Release right mouse button
You should place code that should be executed when an item is actually selected by the right mouse button in the pbm_contextmenu event. This is how PFC ListView objects work in PowerBuilder 7 and later. The code that you want executed when the right mouse button is released on the white area of the ListView should remain in the pbm_rbuttonup event. Because pbm_contextmenu is called twice when you right-click in the white area, you should put code in the RightClicked event to retain the index of the item that was selected. If no item is selected, then the index value will be zero and you should use that as a test in the pbm_contextmenu code to decide whether that code should be executed.
The following example assumes that you have declared a private instance variable of a TreeView standard class user object called ii_item. This statement is in the Clicked! event script:
ii_item = index
The pbm_rbuttonup event script should contain code to be executed when the right mouse button is released after being pressed in the ListView but not on an item in that ListView.
The pbm_contextmenu event script should contain code like the following:
IF ii_item > 0 THEN
// code to be executed when the right mouse
// button is released after being pressed on an
// item in the ListView
The pfc_u_lv and pfc_uv_lvs objects have been modified to use pbm_contextmenu instead of pbm_rbuttonup.