Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsI inherited the following VB Script programs. Can someone tell me what exactly are they doing?
--------------------------
1st script
--------------------------
Dim OdbcDSN
Dim connect, cm
Dim counter
Dim output
Dim strDirectory, strFile,ol,Err
Dim starttime, exittime, x
Dim Objfso, Objfsotext, Objfolder, Objfile,ObjFileDelete
Const adCmdStoredProc = &H0004
Const adParamInput = &H0001
Const adParamOutput = &H0002
Const adVarChar = 200
Const adInteger = 3
Const adNumeric = 131
Const adCmdText = &H0001
Const adCmdUnknown = &H0008
counter = 0
x = 0
OdbcDSN = "DSN=hsdp10a;UID=pps_owner
Set connect = CreateObject("ADODB.Connec
connect.Open OdbcDSN
Set cm = CreateObject("ADODB.Comman
Set cm.ActiveConnection = connect
cm.CommandText = "batch_pkg_rs_util.check_r
cm.CommandType = adCmdStoredProc
set p = cm.Parameters
p.Append cm.CreateParameter("@i_rep
p.Append cm.CreateParameter("@o_rep
cm.execute
if p(1).value = 1 Then
counter=1
else
counter=0
end if
connect.close
set connect=Nothing
If counter = 1 Then
strFile = "C:\RS\Data_for_XREW_Repor
Set objFSO = CreateObject("Scripting.Fi
Set ObjFileDelete = Objfso.GetFile(Strfile)
ObjFiledelete.Delete()
'Wscript.echo "Just deleted" & Strdirectory & Strfile
'Wscript.Quit
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
call objFSO.CreateTextFile(strF
'Wscript.Echo "Just created " & strFile
End If
'END********************
--------------------------
2nd script
--------------------------
Dim OdbcDSN
Dim connect, cm
Dim counter
Dim output
Dim strDirectory, strFile,ol,Err
Dim starttime, exittime, x
Dim Objfso, Objfsotext, Objfolder, Objfile,ObjFileDelete
Const adCmdStoredProc = &H0004
Const adParamInput = &H0001
Const adParamOutput = &H0002
Const adVarChar = 200
Const adInteger = 3
Const adNumeric = 131
Const adCmdText = &H0001
Const adCmdUnknown = &H0008
counter = 0
x = 0
OdbcDSN = "DSN=usta;UID=dbs_owner;PW
Set connect = CreateObject("ADODB.Connec
connect.Open OdbcDSN
Set cm = CreateObject("ADODB.Comman
Set cm.ActiveConnection = connect
cm.CommandText = "batch_pkg_rs_util.check_r
cm.CommandType = adCmdStoredProc
set p = cm.Parameters
p.Append cm.CreateParameter("@i_rep
p.Append cm.CreateParameter("@o_rep
cm.execute
if p(1).value = 1 Then
counter=1
else
counter=0
end if
connect.close
set connect=Nothing
If counter = 1 Then
strFile = "C:\RS\Data_for_Report3_Mo
Set objFSO = CreateObject("Scripting.Fi
Set ObjFileDelete = Objfso.GetFile(Strfile)
ObjFiledelete.Delete()
'Wscript.echo "Just deleted" & Strdirectory & Strfile
'Wscript.Quit
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
call objFSO.CreateTextFile(strF
'Wscript.Echo "Just created " & strFile
End If
'END********************
Thank You
Shariq
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: RobSampsonPosted on 2007-05-09 at 17:07:14ID: 19061792
Comments are available to members only. Sign up or Log in to view these comments.