.vbs in wise script crashes

Thank you ahead of time, and hopefully somone else out there is or has experienced this.
I have been searching the web, asking coworkers but this one stumps me.
I regularly use the Execute VBScript from within wisescript 7.2 but ocassionally I get a crash on the included .vbs scripts.

With the particular one I am encountering now I am reading lines of a file and within that I use the .vbs to collect data from a database. The .vbs is therefor run for each line of the .txt file. The function itself works, but when the wisescript exits I get a crash. I can run the .vbs from outside of the read loop and it still exits with an error.

Dwwin.exe reports
AppName: MyApp.exe AppVer: ModName: vbscript.dll
ModVer: Offset: 00005082

I am using 2 other .vbs scripts in this wisescript and they don't cause this crash. I have called databases in the past from .vbs within wisescript without crashing. When run outside of Wise it exits with a 0, when the wise script has the .vbs commented it exit's properly.

I then replaced the .vbs script with one that contained only a DIM statement. That crashed as well from within the loop and from without. However, when I ran that script and commented out a separate .vbs, no crash. I commented the Dim .vbs and tried the original in that location and crash again.

Tests Run (VB2 required for the wisescript)
Wse + VB1, VB2, VBSuspect in Readloop = All functions work but Crash at wse exit
Wse + VB1, VB2, DimVBS in Readloop = Crash at wse exit
Wse + VB1, VB2, DimVBS = Crash at wse exit
Wse + VB1, VB2, = exit OK
Wse + , VB2, DimVBS = exit OK
Wse + , VB2, VBSuspect = Crash at wse exit

DimVBS contains only "Dim str"
I have run this with and without option explicit and On Error Resume Next.
The issue is then triggered by running the VBSuspect.vbs and or by .vbs execution within the readloop.

What conditions does Wise script put on it's included .vbs executions? I havn 't found documentation on this, but it would probably hold the key to this issue.

---------VBSuspect.vbs------(constants are skipped due to running .vbs within the loop)--------
If SKIPCONST = "1" Then
Const adOpenStatic = 3
Const adLockOptimistic = 3
SetVariable "SKIPCONST", "1"
End If
Set objRecordSet = CreateObject("ADODB.Recordset")
Set objConnection = CreateObject("ADODB.Connection")
On Error Resume Next
objConnection.Open _
"Provider = Microsoft.Jet.OLEDB.4.0; " & _
"Data Source = \\MySERVER\MY.mdb"
objRecordSet.Open "SELECT * FROM [Software Information] WHERE [Footprint] = '" & FOOTPRINT & "'", objConnection, adOpenStatic, adLockOptimistic
If err <> 0 Then
objBID = "Failure"
If objRecordSet.EOF And objRecordSet.BOF Then
objBID = "ERROR"
SetVariable "BID", objRecordset.Fields.Item("BaselineID")

objRecordSet.Open "SELECT * FROM [Software Name and Numbering] WHERE [BaseLineID] = '" & objBID & "'", objConnection, adOpenStatic, adLockOptimistic
SetVariable "SWS", objRecordset.Fields.Item("Status")
End If
End If
Set objRecordSet = Nothing
Set objConnection = Nothing
SetVariable "INSTALL_RESULT", Err.Number
--------------------------END Included Script-----------------------------

0 Comments   [ + ] Show comments

Answers (2)

Posted by: anonymous_9363 14 years ago
Red Belt
What came to mind when I read your post was someone's description of Windows 3.11 (which ran on top of MS-DOS). He said "Think of an elephant balanced on a beach ball, juggling 6 otters." Or something like that.

TBH, I would completely abandon this mix of scripts. Decide on one technology and stick with it. If the WiseScript is being compiled into an EXE, you can do the same with VBS using one of the many VBS-to-EXE conversion utilities.
Posted by: bkruiser 14 years ago
Orange Belt
Point taken.... I should rewrite in VB. My boss said the same thing... I really appreciate you giving him ammo.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ