.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: 1.0.0.0 ModName: vbscript.dll
ModVer: 5.7.0.5730 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.
Question:
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")
FOOTPRINT = GetVariable("APPDATA")
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"
Else
If objRecordSet.EOF And objRecordSet.BOF Then
objBID = "ERROR"
Else
SetVariable "BID", objRecordset.Fields.Item("BaselineID")
objRecordSet.Close
objRecordSet.Open "SELECT * FROM [Software Name and Numbering] WHERE [BaseLineID] = '" & objBID & "'", objConnection, adOpenStatic, adLockOptimistic
SetVariable "SWS", objRecordset.Fields.Item("Status")
objRecordSet.Close
End If
End If
Set objRecordSet = Nothing
objConnection.Close
Set objConnection = Nothing
SetVariable "INSTALL_RESULT", Err.Number
--------------------------END Included Script-----------------------------
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: 1.0.0.0 ModName: vbscript.dll
ModVer: 5.7.0.5730 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.
Question:
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")
FOOTPRINT = GetVariable("APPDATA")
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"
Else
If objRecordSet.EOF And objRecordSet.BOF Then
objBID = "ERROR"
Else
SetVariable "BID", objRecordset.Fields.Item("BaselineID")
objRecordSet.Close
objRecordSet.Open "SELECT * FROM [Software Name and Numbering] WHERE [BaseLineID] = '" & objBID & "'", objConnection, adOpenStatic, adLockOptimistic
SetVariable "SWS", objRecordset.Fields.Item("Status")
objRecordSet.Close
End If
End If
Set objRecordSet = Nothing
objConnection.Close
Set objConnection = Nothing
SetVariable "INSTALL_RESULT", Err.Number
--------------------------END Included Script-----------------------------
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
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.
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
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.