Here is the Vbscript I am trying to run and I get this following error:
Error :"Arguments are of the wrong type, are out of acceptable range or are in conflict with one another".
Code : 800A0BB9
Source: ADODB.Command
- - - - - - - -- - - -- - --- -- - - -
My VBScript is as follows:
__________________________
__________
__________
_________
Dim OdbcDSN
Dim connect, sql, resultSet,cmd
Dim counter
Dim objFSO, objFile, objFiledelete,objParam1, objresult
Dim strDirectory, strFile,ol, Err
Dim starttime, exittime, x
counter = 0
x = 0
OdbcDSN = "DSN=asnath;UID=user;PWD=p
ass"
Set connect = CreateObject("ADODB.Connec
tion")
connect.Open OdbcDSN
Set cmd = CreateObject("ADODB.Comman
d")
Set cmd.ActiveConnection = connect
cmd.CommandText = "batch_pkg_rs_util.check_r
eport_stat
us"
cmd.CommandType = adCmdStoredProc
set objParam1 = cmd.CreateParameter("@i_re
port_name"
)
objParam1.Type = adVarChar2
objParam1.Direction = adParamInput
objParam1.Value = lastName
cmd.Parameters.Append objParam1
set objresult = cmd.CreateParameter("@o_re
port_run_s
tatus")
objresult.Type = adVarChar
objresult.Direction = adParamOutput
objresult.Value = output
cmd.Parameters.Append objresult
cmd.Execute
If Err.Number <> 0 Then
counter =0
else
if cmd.Parameters("@result").
Value = 1 Then
counter =1
end if
end if
If counter = 1 Then
strFile = "C:\RS\DatabaseUploaded.tx
t"
Set objFSO = CreateObject("Scripting.Fi
leSystemOb
ject")
Set objFiledelete = objFSO.GetFile(strFile)
objFiledelete.Delete ()
starttime = timer
exittime = starttime + 2
'Wscript.Echo "pausing" & strFile
do while timer < exittime
x= x + 1
loop
'Wscript.Echo "done" & starttime
'Wscript.Echo "Just deleted " & strFile
WScript.Sleep 100
'Wscript.Echo "pausing" & strFile
Set objFile = objFSO.CreateTextFile(strF
ile, True)
'Wscript.Echo "Just created " & strFile
Wscript.Quit
Set ol = Nothing
End If
'END********************
Please help me to resolve this issue ASAP. Thanks in advance!!!
asnath
Start Free Trial