DTS and VB using WithEvents (HELP!!!!) 
Author Message
 DTS and VB using WithEvents (HELP!!!!)

Hello Everybody,
    I have a dts that has 4 steps.
Step 1 is vbscript that reads the file and reformats data.
Step 2 is Datapump that reads the file and inserts into a tale.
Step3 is inserting into interface log number of records processed
Step4 is deletion of the file

For some reason after the step2 finishes the OnQueryCancel event is
getting "PBCancel = True".

I have no clue as to why this happens.

If I don't do the withevents and just exec the package it works just
fine.

Any Ideas???

Here is my code :

Private WithEvents objpkg As DTS.Package

    Set objpkg = New DTS.Package

    objpkg.LoadFromSQLServer "NAHOU-SQPL001P", "", "", "256", , , ,
strDTSTechName

    For i = 1 To objpkg.Steps.Count
        objpkg.Steps(i).ExecuteInMainThread = True
    Next i

    objpkg.Execute

Any help is appreciated.

Thanks

Shabnam



Sat, 29 May 2004 05:34:42 GMT
 DTS and VB using WithEvents (HELP!!!!)

pbCancel is a ByRef variable, it defaults to true, you need to change it to
false in the event stub.

--
-Euan

Please reply only to the newsgroup so that others can benefit. When posting,
please state the version of SQL Server being used and the error number/exact
error message text received, if any.

Hello, I'm the humble disclaimer. Nobody really likes me. I'm used to being
ignored and maligned - I still get the job done. If you cared enough to read
me, you'd learn that this posting is provided "AS IS" with no warranties,
and confers no rights.


Quote:
> Hello Everybody,
>     I have a dts that has 4 steps.
> Step 1 is vbscript that reads the file and reformats data.
> Step 2 is Datapump that reads the file and inserts into a tale.
> Step3 is inserting into interface log number of records processed
> Step4 is deletion of the file

> For some reason after the step2 finishes the OnQueryCancel event is
> getting "PBCancel = True".

> I have no clue as to why this happens.

> If I don't do the withevents and just exec the package it works just
> fine.

> Any Ideas???

> Here is my code :

> Private WithEvents objpkg As DTS.Package

>     Set objpkg = New DTS.Package

>     objpkg.LoadFromSQLServer "NAHOU-SQPL001P", "", "", "256", , , ,
> strDTSTechName

>     For i = 1 To objpkg.Steps.Count
>         objpkg.Steps(i).ExecuteInMainThread = True
>     Next i

>     objpkg.Execute

> Any help is appreciated.

> Thanks

> Shabnam



Sat, 29 May 2004 14:30:05 GMT
 DTS and VB using WithEvents (HELP!!!!)
Could you please show me some code. From what I can tell it is false in the
begining and becomes true after step2 is finished.

Shabnam

Quote:

> pbCancel is a ByRef variable, it defaults to true, you need to change it to
> false in the event stub.

> --
> -Euan

> Please reply only to the newsgroup so that others can benefit. When posting,
> please state the version of SQL Server being used and the error number/exact
> error message text received, if any.

> Hello, I'm the humble disclaimer. Nobody really likes me. I'm used to being
> ignored and maligned - I still get the job done. If you cared enough to read
> me, you'd learn that this posting is provided "AS IS" with no warranties,
> and confers no rights.



> > Hello Everybody,
> >     I have a dts that has 4 steps.
> > Step 1 is vbscript that reads the file and reformats data.
> > Step 2 is Datapump that reads the file and inserts into a tale.
> > Step3 is inserting into interface log number of records processed
> > Step4 is deletion of the file

> > For some reason after the step2 finishes the OnQueryCancel event is
> > getting "PBCancel = True".

> > I have no clue as to why this happens.

> > If I don't do the withevents and just exec the package it works just
> > fine.

> > Any Ideas???

> > Here is my code :

> > Private WithEvents objpkg As DTS.Package

> >     Set objpkg = New DTS.Package

> >     objpkg.LoadFromSQLServer "NAHOU-SQPL001P", "", "", "256", , , ,
> > strDTSTechName

> >     For i = 1 To objpkg.Steps.Count
> >         objpkg.Steps(i).ExecuteInMainThread = True
> >     Next i

> >     objpkg.Execute

> > Any help is appreciated.

> > Thanks

> > Shabnam



Sat, 29 May 2004 22:23:43 GMT
 DTS and VB using WithEvents (HELP!!!!)


Quote:
>Could you please show me some code.

http://support.microsoft.com/support/kb/articles/q221/1/93.asp

Pre-built sample available from-
http://www.sqldts.com/article.asp?nav=1,6,208,7,3
--
Darren Green (SQL Server MVP)
http://www.sqldts.com

(Which version of SQL Server? What is the full error message?)



Sun, 30 May 2004 04:14:17 GMT
 DTS and VB using WithEvents (HELP!!!!)
Thanks!!
Quote:



> >Could you please show me some code.

> http://support.microsoft.com/support/kb/articles/q221/1/93.asp

> Pre-built sample available from-
> http://www.sqldts.com/article.asp?nav=1,6,208,7,3
> --
> Darren Green (SQL Server MVP)
> http://www.sqldts.com

> (Which version of SQL Server? What is the full error message?)



Tue, 01 Jun 2004 23:51:04 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Using VB WithEvents and DTS ActiveScript

2. DTS Problems in VB (WithEvents)

3. DTS VB - Error executing Package declare withevents

4. DTS (& ActiveX) Problems in VB (WithEvents)

5. Using DTS WIthEvents

6. Using DTS from VB - DTS.Package not defined?

7. Making 1 packages for DTS 7 and DTS 2000 using VB

8. SQLMerge WithEvents in VB.NET

9. SQLMerge object WithEvents in VB.NET

10. Using Withevents

11. using WithEvents in ADO

12. SQLRestore causes Err EXCEPTION_ACCESS_VIOLATION when declared using WithEvents


 
Powered by phpBB® Forum Software