Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
raritan
Starting Member
39 Posts |
Posted - 2007-08-15 : 17:36:19
|
I have a DTS package set up with some code in an activex script that sets some global variables in my package. The package runs fine from my computer. But when someone else goes to enterprise manager from their computer and executes the package, it errors out on the step where the script it run and says there is a run-time error. Why is this happening just on that machine, and how can I de-bug while running it on that machine to see why it's erroring out, on what line of code? Here is the code:Function Main()Set OpenFileDialog = CreateObject("MSComDlg.CommonDialog")With OpenFileDialog .DialogTitle = "Select Data Source" .Filter = "All Files|*.*" .FilterIndex = 4 .MaxFileSize = 1024 .InitDir = "S:\NBC\MCI\CDRs\" .ShowOpenEnd WithMyStr = OpenFileDialog.FileNameMyChrPos = InStrRev(MyStr, "\")MyStrLen = Len(MyStr)MyFileName = Mid(MyStr, (MyChrPos + 1), (MyStrLen - MyChrPos))MyEndFileName = Right(MyStr, 31)Select Case Left(MyEndFileName, 8) Case "01002246" MyCarrierName = "MCI" Case Else MyCarrierName = InputBox("This filename does not begins with '01002246'. Enter Name of Carrier (Qwest or MCI):", "Carrier Name" )End SelectMyEMRFileName = InputBox("Enter EMR filename:", "EMR File For Billing" )DTSGlobalVariables("gVarData_Source").Value = MyStrDTSGlobalVariables("gVarImport_File").Value = MyFileNameDTSGlobalVariables("gVarEMR_File").Value = MyEMRFileNameDTSGlobalVariables("gVarCarrier_Name").Value = MyCarrierNameMain = DTSTaskExecResult_SuccessEnd FunctionThanks for your help,Kevin |
|
raritan
Starting Member
39 Posts |
Posted - 2007-08-16 : 10:32:07
|
ok I see now that I needed to turn on the just-in-time debugging in enterprise manager, which I have done. Now I believe I have to put a STOP statement in my code in order for the debugger to work when it finds a runtime error. Where do I need to place the statement and what is the syntax?Thank youKevin |
|
|
Stevan2020
Starting Member
25 Posts |
Posted - 2007-08-16 : 10:56:46
|
You can use a messagebox to write variables to the screenif sDebug = "1" then MsgBox(" Running in Debug mode")end if ...code...MyChrPos = InStrRev(MyStr, "\")if sDebug = "1" then MsgBox(MyChrPos )end if -- Steve |
|
|
raritan
Starting Member
39 Posts |
Posted - 2007-08-16 : 11:46:24
|
that's fine, but will this open the script debugger and allow me to see which line of code is erroring out, and will it tell me the name of the run-time error? that's what I really need to know.Thanks,Kevin |
|
|
raritan
Starting Member
39 Posts |
Posted - 2007-08-20 : 09:06:04
|
bump |
|
|
|
|
|
|
|