title: Error handling in vbscript?
body: <p>There is some old legacy vbscript code we have that needs some sort of error handing in it.  Having never used vbscript before, I'm at a total loss.  Here is the code:</p>
  
  <pre><code>set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")
  objBL.ConnectionString = "connectionstring"
  objBL.KeepIdentity = false
  objBL.ErrorLogFile = "E:\code\Acquity\WebOrderImport\logs\error.log"
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set parentfolder = fso.GetFolder("E:\textdata\Acquity\AcquityWebOrders")  
  Set logfile = fso.OpenTextFile("E:\code\Acquity\WebOrderImport\logs\import.log",8)
  count = 0
      For each folder in parentfolder.subfolders
          logfile.writeline count &amp; " files"
          logfile.writeline "Processing " &amp; folder.name &amp; " ***********************************" &amp; now()
          count = 1
          For Each file in folder.files
              If left(file.name,6) = "Order_" then
                  If left(file.name,13) = previous then
                      logfile.writeline "!!!!! SKIPPING file " &amp; file.name &amp; "!!!!! DUPED ORDER ID"
                  Else
                      logfile.writeline "reading " &amp; file.name        
                      objBL.Execute "E:\code\Acquity\WebOrderImport\acq_WebOrder_import.xsd", file.path                   
                      count=count+1
                  End If  
              previous = left(file.name,13)
              End If
          Next
      Next    
  
  set objBL=Nothing
  logfile.writeline "Done!"
  Set logfile = nothing
  Set parentfolder = nothing
  set fso = nothing
  </code></pre>
  
  <p>I'm pretty sure this line:</p>
  
  <pre><code>bjBL.Execute "E:\code\Acquity\WebOrderImport\acq_WebOrder_import.xsd", file.path
  </code></pre>
  
  <p>keeps throwing exceptions, and I need the code to keep running when it hits an error, rather than stopping.  How can I do this?</p>