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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 hellllp with errors!!!!

Author  Topic 

sakheb
Starting Member

4 Posts

Posted - 2002-05-29 : 09:42:13
I have a DTS which has an ActiveX script. I want to do error handling in the ActiveX script. For example, when the script tries to open a file and it doesn't exist, I want it to do something.
I tried using the regular VB error handling techniques:
"On Error GoTo errHandler"
but it doesn't work in ActiveX.........what can I do????????

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-29 : 14:42:20
Why not test for the existance of the file before you try to open it?

<O>
Go to Top of Page

MuffinMan
Posting Yak Master

107 Posts

Posted - 2002-05-29 : 15:24:29
The ActiveX script in a DTS package uses VBScript, not VB syntax. Thus, the "... goto ErrHandler" that you use in VB won't work.

The only options in VBScript are:
1) On Error Resume Next
2) On Error Goto 0 (this turns off error handling)

Example:

On Error Resume Next
Set MyFile = fso.OpenTextFile(........)
If Err.Number = 0 then
'Success!
Else
'an error occurred
End If



Go to Top of Page

sakheb
Starting Member

4 Posts

Posted - 2002-05-29 : 15:42:49
I may be able to work with this...........Thanks a lot

Go to Top of Page
   

- Advertisement -