-1

On one of my PowerBuilder apps, this strange thing happens: on 99% of the machines where the app is used, everything is fine. But there is one Win7 machine that throws this error:

Error code = 39
Error message = Error accessing external object property language at line 77 in constructor event of object uo_web
Error line = 77

That line corresponds to this code:

int li_rc

OleObject lnv_MSScript

lnv_MSScript = Create OleObject

// Create a script object to use for URL Encoding/Decoding

li_RC = lnv_MSScript.ConnectToNewObject ("MSScriptControl.ScriptControl")
If li_RC = 0 Then
lnv_MSScript.language ="javascript"
Else
Messagebox('Error', 'Unable to connect to script control. Return Code = ' + string(li_RC))
Return
End If

What could be causing this? I know that the app uses Internet Explorer, and we made sure the troubled PC has IE version 11. I also know that this line was added when we had trouble reading unicode data (nvarchar) from a (sql server) database to the app window.

If there are some debug data I may additionally provide, please indicate to me so, because I am not proficient in powerbuilder enough to know this.

George Menoutis
  • 6,894
  • 3
  • 19
  • 43

1 Answers1

0

Things to check

  • Is Windows 7 32 or 64 bit?
  • Is your application 32 or 64 bit?
  • Is Office installed? Is it 32 or 64 bit?
  • Does your version of script control support "language"?

The bit version of the OCX needs to match your application. Frequently Windows and Office install the version of OCX that it requires. If Windows or Office are 64 bit and your application is 32 bit then you'll need to install the 32 bit OCX.

Hope this helps!


Does your version of script control support "language"?

On the machine that fails, you can save these lines into a file.

Dim MyScript 
wscript.echo "Create object"
set MyScript = CreateObject("MSScriptControl.ScriptControl")
wscript.echo "Setting language to javascript"
MyScript.language = "javascript"

(Example: create folder c:\mytests then save as c:\mytests\testscript.vbs)

Open a command prompt (run CMD.EXE)

Type

CD c:\mytests

Try

cscript testscript.vbs

or

C:\windows\sysWOW64\cscript testscript.vbs

or

C:\windows\system32\cscript testscript.vbs

Something like this should appear

Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

Create object
Setting language to javascript

Otherwise you may see something like this

Microsoft VBScript runtime error: Object doesn't support this property or method

Search for your error message in your favorite search engine.

Eric Glenn
  • 389
  • 2
  • 12