SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Error Using JALScript Commands from VBScript

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Error Using JALScript Commands from VBScript
Author Message
Arthur Heezen



Joined: 09 Apr 2004
Posts: 5

Post Error Using JALScript Commands from VBScript Reply with quote

I have many VB scripts that execute JAL commands,
and it works most of the time. However, I sometimes
get the error 24 "Unable to register JALScript
Interface object"

This causes a lot of trouble, because I do not want
to trap for this error. Do you have any suggestions?
A sample of code for which I sometimes get the
error follows.

Sub Main()

'Declare and get objects
Dim objCmd
Set objCmd = CreateObject("ADODB.Command")

'Run the test command
objCmd.ActiveConnection = "Provider=SQLOLEDB; Data Source=NLGPFMGSQL14; Initial Catalog=DatamartRob; Integrated Security = SSPI;"
objCmd.CommandType = 1 'Text
objCmd.CommandText = "SELECT * FROM OPENQUERY(WAREDB2A,'SELECT 1 AS DRSD_TRANS_DT FROM WAREHSEP.AGY_PROD_GRP_VW')"
objCmd.Execute()
If Err.Number 0 Then

JalCommand = "LogAddMessageEx ""INFO""" & "," & """@V"job_id"""" & "," & """@V"job_name"""" & ", ""DB2 returned an error""" + vbCrLf

JALScript.Execute(JalCommand)

Set objCmd = Nothing
Else

JalCommand = "LogAddMessageEx ""INFO""" & "," & """@V"job_id"""" & "," & """@V"job_name"""" & ", ""DB2 available - generating semaphore file for step 03""" + vbCrLf

JALScript.Execute(JalCommand)

Dim fso, outFile

Set fso = CreateObject("Scripting.FileSystemObject")

Set outFile = fso.CreateTextFile("E:\Datamart\SalesReporting\03 Exec SalesReporting usp00GetDB2Data.24x7", True)

outFile.Close

fso.DeleteFile("E:\Datamart\SalesReporting\02 Test for DB2 Availability.24x7")

Set fso = Nothing

Set objCmd = Nothing
End If
End Sub

Wed Aug 18, 2004 8:39 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Error Using JALScript Commands from VBScript Reply with quote

While I am checking what that error means and what could be causing that I would like to suggest an alternative method for message logging

Dim fso, logFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set logFile = fso.OpenTextFile("C:\Program Files\24x7 Automation 3\schedule.log", 2, True)
logFile.WriteLine "INFO" & vbTab & "@V"job_id"" & vbTab & "@V"job_name"" & vbTab & "0" & vbTab & "DB2 returned an error"
logFile.Close

: I have many VB scripts that execute JAL commands,
: and it works most of the time. However, I sometimes
: get the error 24 "Unable to register JALScript
: Interface object"

: This causes a lot of trouble, because I do not want
: to trap for this error. Do you have any suggestions?
: A sample of code for which I sometimes get the
: error follows.

: Sub Main()

: 'Declare and get objects
: Dim objCmd
: Set objCmd = CreateObject("ADODB.Command")

: 'Run the test command
: objCmd.ActiveConnection = "Provider=SQLOLEDB; Data Source=NLGPFMGSQL14;
: Initial Catalog=DatamartRob; Integrated Security = SSPI;"
: objCmd.CommandType = 1 'Text
: objCmd.CommandText = "SELECT * FROM OPENQUERY(WAREDB2A,'SELECT 1 AS
: DRSD_TRANS_DT FROM WAREHSEP.AGY_PROD_GRP_VW')"
: objCmd.Execute()
: If Err.Number 0 Then

: JalCommand = "LogAddMessageEx ""INFO""" &
: "," &
: """@V"job_id"""" &
: "," &
: """@V"job_name"""" & ",
: ""DB2 returned an error""" + vbCrLf

: JALScript.Execute(JalCommand)

: Set objCmd = Nothing
: Else

: JalCommand = "LogAddMessageEx ""INFO""" &
: "," &
: """@V"job_id"""" &
: "," &
: """@V"job_name"""" & ",
: ""DB2 available - generating semaphore file for step
: 03""" + vbCrLf

: JALScript.Execute(JalCommand)

: Dim fso, outFile

: Set fso = CreateObject("Scripting.FileSystemObject")

: Set outFile = fso.CreateTextFile("E:\Datamart\SalesReporting\03 Exec
: SalesReporting usp00GetDB2Data.24x7", True)

: outFile.Close

: fso.DeleteFile("E:\Datamart\SalesReporting\02 Test for DB2
: Availability.24x7")

: Set fso = Nothing

: Set objCmd = Nothing
: End If
: End Sub

Wed Aug 18, 2004 9:20 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Error Using JALScript Commands from VBScript Reply with quote

Regarding error #24. This could happen if some DLL or LIB file is locked and 24x7 cannot load code of VBS-to-JAL interface object or other referenced objects from such file. I believe it is caused by a short temporary lock created by a concurrent job and if the job is re-run in few seconds it should be able to obtain access to the required code.

I cannot say right now which file is locked.

: While I am checking what that error means and what could be causing that I
: would like to suggest an alternative method for message logging

: Dim fso, logFile
: Set fso = CreateObject("Scripting.FileSystemObject")
: Set logFile = fso.OpenTextFile("C:\Program Files\24x7 Automation
: 3\schedule.log", 2, True)
: logFile.WriteLine "INFO" & vbTab &
: "@V"job_id"" & vbTab &
: "@V"job_name"" & vbTab & "0" &
: vbTab & "DB2 returned an error"
: logFile.Close

Wed Aug 18, 2004 9:53 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.