Object element

How it works

ActiveX controls use the Object element to specify the GUID (a unique identifier) of the control as well as the space the control takes on the page. The Object tag looks like this:

<OBJECT id=PSDWC1 height=357 classid="CLSID:CCCC1503-CCCC-1000-8000-080009AC61A9" width=343>
</OBJECT>

CODEBASE attribute

If your users need to download the controls, you can include the CODEBASE attribute in the Object element to identify the file to be downloaded. After the browser downloads the CAB file, it unpacks it and registers the ActiveX controls in the user’s system registry.

The value for CODEBASE has the format:

url#version

A typical value for CODEBASE uses a relative URL:

CODEBASE="cabs/psdwc125.cab#12,0,0,1053"

URL The URL is the location of the DataWindow control’s CAB file on your Web server. It can be an absolute or relative URL.

Version The version is a set of four numbers, separated by commas. The numbers must match the version of the CAB file. The version number of the CAB file is the same as the version number for PowerBuilder.

StepsTo find out the 4-part version number in Windows:

  1. Select the PowerBuilder executable or a PowerBuilder DLL in Windows Explorer.

  2. Select File>Properties from the menu bar.

  3. On the Version tab, look at File Version. A typical number is 12.5.0.1053.

Example

The Object element with a CODEBASE attribute looks like this:

<OBJECT codeBase=
"http://www.domain.com/psdwc125.cab#Version=12,0,0,
1053" id=PSDWC1 height=357 classid="CLSID:CCCC1503-CCCC-1000-8000-080009AC61A9" width=343>
</OBJECT>

New versions

When you get new versions of the CAB file, you can change the version numbers on the Web page and cause the browser to install a new version of the control.

For more information about how to deploy new versions, see “Deploying the Web ActiveX”.

Putting the Object tag in a separate file

If the Cumulative Security Update for Internet Explorer (912812) or a subsequent update is installed on the computer where the Web ActiveX control is running, a browser refresh does not refresh the control correctly. This update is described in Microsoft Security Bulletin MS06-013, published in April 2006.

To work around this issue, put the <OBJECT> tag in a separate JavaScript file instead of the main HTML file, as shown in this example:

// HTML file
<HTML>
<HEAD>
   <TITLE>test</TITLE>
</HEAD>
<BODY bgColor="white" PSPARAMS="">
<P>Put your data here </P>
<P>&nbsp;</P>
<P>
   <div id="DivID">
      <script src="createElement.js"></script>
   </div>
</BODY>
</HTML>

The createElement.js JavaScript file contains the Object tag:

// createElement.js file
var d = document.getElementById("DivID");
d.innerHTML = 
'<OBJECT id="OBJECT1" style="WIDTH: 627px; HEIGHT: 320px" codeBase="psdwc125.cab" classid="CLSID:CCCC1503-CCCC-1000-8000-080009AC61A9">'
+'<PARAM NAME="_Version" VALUE="65536"></PARAM>'
+'<PARAM NAME="_ExtentX" VALUE="16589"></PARAM>'
+'<PARAM NAME="_ExtentY" VALUE="8467"></PARAM>'
+'<PARAM NAME="_StockProps" VALUE="2"></PARAM>'
+'<PARAM NAME="Caption" VALUE=""></PARAM>'
+'<PARAM NAME="SourceFileName" VALUE="test.psr"></PARAM>'
+'<PARAM NAME="DataWindowObject" VALUE="test.psr"></PARAM>'
+'<PARAM NAME="LogId" VALUE=""></PARAM>'
+'<PARAM NAME="LogPass" VALUE=""></PARAM>'
+'<PARAM NAME="dbParm" VALUE=""></PARAM>'
+'<PARAM NAME="SuppressEvents" VALUE="0"></PARAM>'
+'<PARAM NAME="VScrollBar" VALUE="0"></PARAM>'
+'<PARAM NAME="HScrollBar" VALUE="0"></PARAM>'
+'<PARAM NAME="HSplitScroll" VALUE="0"></PARAM>'
+'<PARAM NAME="LiveScroll" VALUE="0"></PARAM>'
+'</OBJECT>';