Note that there are some explanatory texts on larger screens.

plurals
  1. POError handling in vbscript?
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload