0
我試圖通過VB腳本連接命令提示符,並進一步與Oracle環境連接以執行Oracle發現者的一些報告。 但問題是隻有這個VB腳本。VB腳本運行查詢
第2行:用於建立連接。 第7行:獲取當前的REQUEST_ID。 第16行:XXDIS_EXPORT_CMD_V是一個視圖,cmd是一個列,它爲相應的REQUEST_ID選擇一個像這樣的值。 /CONNECT DISCADMIN: 「FAI財務智能」/ discbi @ deverp/OPENDB 「1個計劃」/張 「Sheet_1」/導出HTML o27673334.out/LOGFILE l27673334.log /批
最後,我想執行這個使用VBScript的cmd。
錯誤來:
"In line 32 tkgoShell was not recognized"
這是我的代碼:
' Process job
Set objADO =CreateObject("ADODB.Connection")
objADO.Open "Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=deverp; UID=apps; PWD=apps11i;"
MsgBox "Connection Established to Server.", vbExclamation + vbOKOnly, "System"
Do While True
' Check if there is a job to process
Set moRS=objADO.execute("SELECT apps.xxdis_schedule_pkg.start_job REQUEST_ID FROM dual")
moRS.MoveFirst
msRequest = moRS("REQUEST_ID")
'MsgBox msRequest,msRequest
' If no jobs then exit
' If msRequest = "0" Then
Exit Do
' End If
loop
Set moRS=objADO.execute("SELECT cmd EXPORT_CMD FROM apps.xxdis_export_cmd_v " & _
"WHERE request_id = " & msRequest)
MsgBox msRequest,msRequest
moRS.MoveFirst
msExpCmd = moRS("EXPORT_CMD")
' write command into a temporary file
msCmdFile = "r" & msRequest & ".cmd"
dim moOutputStream,filesys,msCommand
Set filesys = CreateObject("Scripting.FileSystemObject")
Set moOutputStream = filesys.CreateTextFile(msCmdFile, True)
' Substitute $SAMBA$ and $TNS$ locally configured variables
moOutputStream.Write Replace(Replace(msCmd, "$SAMBA$", gsOutDir),_
"$TNS$", gsInstance) & vbCRLF
moOutputStream.Close
' Call Discoverer to process the command
msCommand = gsBinDir & gsDiscoExe & " /EUL " & gsEUL & " /CMDFILE " & msCmdFile
Call tkgoShell.Run (msCommand, 1, true)
我做了更改nd我現在得到這個錯誤。錯誤:無法等待進程,代碼:80020009 Source:WshShell.Run,Line:35 – 2010-12-09 08:29:44