1 Reply Latest reply on Jan 9, 2009 5:41 PM by gdarling - oracle

    running loops in VBscript

      hi everyone
      I am naresh,

      i have written the following code in vbscript

      Sub test
      Dim tkgoDB,msConnect,gsUser,gsPassword,gsInstance,moRS

      gsUser=" "
      gsInstance=" "

      Set tkgoDB =CreateObject("ADODB.Connection")

      msConnect = "UID=" & apps & ";PWD=" & apps & ";CONNECTSTRING=" & dev01
      tkgoDB.Open "Driver={Microsoft ODBC for Oracle};" & msConnect
      Do While True
      Set moRS=tkgoDB.execute("SELECT apps.aa_scheduled_pkg.start_job REQUEST_ID FROM dual")
      msRequest = moRS("REQUEST_ID")
      End Do
      End Sub

      while i am typing in command prompt as WScript testcode1.vbs it is giving error as Expected statement at 16

      I am new to this Vscript

      Please helpme

      Any can any one know how to execute vbscript code through command prompt...

      Thank you In advance..
        • 1. Re: running loops in VBscript
          gdarling - oracle

          Your question seems unrelated to .NET Stored Procedures which this forum deals with.

          For that matter, it seems unrelated to Oracle as a vbs file that contains nothing but the following also errors with the same:

          Do While True
          End Do

          Also, I dont see that your code would ever break out of the loop.

          Anyway, to answer your question, you run a vbscript file from a command prompt simply by typing the name of it, and heres a simple example of a vbs file using odbc to select from emp.

          Hope it helps,


          set con = createobject("adodb.connection")
          con.open "dsn=orcl;uid=scott;pwd=tiger"
          set rs = createobject("adodb.recordset")
          rs.open "select ename from emp",con
          while not rs.eof
          rslt = rslt & rs.fields(0).value & " "
          msgbox rslt