dbTalk Databases Forums  

On Error Goto Label dosen't work in ActiveX script

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss On Error Goto Label dosen't work in ActiveX script in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ray5531
 
Posts: n/a

Default On Error Goto Label dosen't work in ActiveX script - 05-02-2005 , 03:48 PM






I'm trying to use On Error Goto Label in the main funtion of my ActiveX
task,but it says syntax error.How can I use that?

Thanks



Reply With Quote
  #2  
Old   
Ray5531
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-02-2005 , 03:52 PM






How can I handle unexpexted errors in my ActiveX code?

Thanks
"Ray5531" <RayAll (AT) microsft (DOT) com> wrote

Quote:
I'm trying to use On Error Goto Label in the main funtion of my ActiveX
task,but it says syntax error.How can I use that?

Thanks




Reply With Quote
  #3  
Old   
Helge C. Rutz
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-03-2005 , 04:46 AM



Hi Ray,

"Ray5531" <RayAll (AT) microsft (DOT) com> schrieb im Newsbeitrag
news:%234wloj1TFHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
How can I handle unexpexted errors in my ActiveX code?
scripting doesn't suport labels. Just use
On Error Resume Next
instead and check the result of each call that could fail.

Helge




Reply With Quote
  #4  
Old   
Ray5531
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-03-2005 , 11:50 AM



I don;t have calls actually in my script.For instance in my script I have
FSO object that might be faild due to existance of the same file in the
destination directory and error of these kinds.How should I handle these
types of errors?

Thanks
"Helge C. Rutz" <news050424 (AT) nurfuerspam (DOT) de> wrote

Quote:
Hi Ray,

"Ray5531" <RayAll (AT) microsft (DOT) com> schrieb im Newsbeitrag
news:%234wloj1TFHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
How can I handle unexpexted errors in my ActiveX code?

scripting doesn't suport labels. Just use
On Error Resume Next
instead and check the result of each call that could fail.

Helge




Reply With Quote
  #5  
Old   
Ray5531
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-03-2005 , 12:46 PM



Sorry,I forgot to ask how can I get the description of the error that has
just happened.

Thanks
"Helge C. Rutz" <news050424 (AT) nurfuerspam (DOT) de> wrote

Quote:
Hi Ray,

"Ray5531" <RayAll (AT) microsft (DOT) com> schrieb im Newsbeitrag
news:%234wloj1TFHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
How can I handle unexpexted errors in my ActiveX code?

scripting doesn't suport labels. Just use
On Error Resume Next
instead and check the result of each call that could fail.

Helge




Reply With Quote
  #6  
Old   
Helge C. Rutz
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-03-2005 , 05:24 PM



Hi Ray,

"Ray5531" <RayAll (AT) microsft (DOT) com> schrieb im Newsbeitrag
news:ON96wfAUFHA.3644 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
Sorry,I forgot to ask how can I get the description of the error that has
just happened.
when you want to program activeX tasks you should be familiar with vb
scripting (vbs) or java scripting.

When an error occurs the global error object "Err" gets all error
information.
You just have to check Err.Number and Err.Description, typically with an
If Err.Number <> 0 ...
For further study you may start here
http://msdn.microsoft.com/library/de...asp?frame=true

Helge




Reply With Quote
  #7  
Old   
Ray5531
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-03-2005 , 08:27 PM



I hope Err gives me what I want.I will give it a shot and I'll get back to
you if there is any questions.

Thanks for your help,


"Helge C. Rutz" <news050424 (AT) nurfuerspam (DOT) de> wrote

Quote:
Hi Ray,

"Ray5531" <RayAll (AT) microsft (DOT) com> schrieb im Newsbeitrag
news:ON96wfAUFHA.3644 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Sorry,I forgot to ask how can I get the description of the error that has
just happened.

when you want to program activeX tasks you should be familiar with vb
scripting (vbs) or java scripting.

When an error occurs the global error object "Err" gets all error
information.
You just have to check Err.Number and Err.Description, typically with an
If Err.Number <> 0 ...
For further study you may start here
http://msdn.microsoft.com/library/de...asp?frame=true

Helge




Reply With Quote
  #8  
Old   
Mike Gercevich via SQLMonster.com
 
Posts: n/a

Default Re: On Error Goto Label dosen't work in ActiveX script - 05-13-2005 , 06:50 AM



Could you just use the FileExists method like....

IF NOT oFSO.FileExists( myFilePath ) Then
'do some action
ELSE
'do some error task
END IF

-Mike Gercevich

--
Message posted via http://www.sqlmonster.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.