dbTalk Databases Forums  

Whats wrong in this vb code?VB newbie pls help...

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


Discuss Whats wrong in this vb code?VB newbie pls help... in the microsoft.public.sqlserver.dts forum.



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

Default Whats wrong in this vb code?VB newbie pls help... - 12-07-2003 , 12:33 PM






I am trying to load a Package from a repository, my server name has a
funny name but i get this mssage....could someone give a hint where I
am going wrong?


Private Sub Form_Load()
Dim pkg As DTS.Package
pkg.LoadFromRepository "17433136281", "msdb", "sa", "",
"{B3E46B63-FEE6-43CB-849B-8C87510FE4CA}", , "test",
DTSReposFlag_Default
pkg.WriteCompletionStatusToNTEventLog = False
pkg.LogFileName = "c:\dts\error\northwindolapunleashed.txt"
pkg.FailOnError = False
pkg.PackagePriorityClass = DTSPriorityClass_Normal
pkg.MaxConcurrentSteps = 8
pkg.LineageOptions = DTSLineage_AddLineageVariables +
DTSLineage_WriteToReposIfAvailable
pkg.UseTransaction = True
pkg.TransactionIsolationLevel = DTSIsoLevel_ReadCommitted

End Sub

I get the message Object variable with block variable not set.....The
QL server has been checked out by me and I have alsoput the correct Id
fro the package...



Thnaks in anticipation



Ajay

Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: Whats wrong in this vb code?VB newbie pls help... - 12-08-2003 , 06:56 AM






Same thing as your previous issue - you aren't creating a
package object, you are just declaring it and trying to use
it. Try declaring it using the New keyword:
Dim pkg as New DTS.Package
Alternatively, you can use:
Dim pkg as DTS.Package
Set pkg = New DTS.Package

-Sue

On 7 Dec 2003 10:33:39 -0800, ajayz90 (AT) hotmail (DOT) com (Ajay
Garg) wrote:

Quote:
I am trying to load a Package from a repository, my server name has a
funny name but i get this mssage....could someone give a hint where I
am going wrong?


Private Sub Form_Load()
Dim pkg As DTS.Package
pkg.LoadFromRepository "17433136281", "msdb", "sa", "",
"{B3E46B63-FEE6-43CB-849B-8C87510FE4CA}", , "test",
DTSReposFlag_Default
pkg.WriteCompletionStatusToNTEventLog = False
pkg.LogFileName = "c:\dts\error\northwindolapunleashed.txt"
pkg.FailOnError = False
pkg.PackagePriorityClass = DTSPriorityClass_Normal
pkg.MaxConcurrentSteps = 8
pkg.LineageOptions = DTSLineage_AddLineageVariables +
DTSLineage_WriteToReposIfAvailable
pkg.UseTransaction = True
pkg.TransactionIsolationLevel = DTSIsoLevel_ReadCommitted

End Sub

I get the message Object variable with block variable not set.....The
QL server has been checked out by me and I have alsoput the correct Id
fro the package...



Thnaks in anticipation



Ajay


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 - 2012, Jelsoft Enterprises Ltd.