dbTalk Databases Forums  

Import a BAS module to MSDE?

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


Discuss Import a BAS module to MSDE? in the microsoft.public.sqlserver.dts forum.



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

Default Import a BAS module to MSDE? - 11-16-2006 , 08:54 AM






I would like to import a DTS package that has been saved as a BAS module
into MSDE from within a VBA script. Is this possible?

Thanks for your time.

Craig Buchanan



Reply With Quote
  #2  
Old   
Craig Buchanan
 
Posts: n/a

Default Re: Import a BAS module to MSDE? - 11-16-2006 , 12:58 PM






found a good way to do this with .DTS files. script needs to be in the same
directory as the DTS files.

Dim Path:
Path=Left(WScript.ScriptFullName,Len(WScript.Scrip tFullName)-Len(WScript.ScriptName)-1)

'names of package files
Dim Sources: Sources = Array("XXX.dts","YYY.dts")

Dim i
For i = 0 To Ubound(Sources)
'Msgbox Path & "\" & Sources(i)
Import Path & "\" & Sources(i)
Next

Sub Import(FilePath)

Dim P: Set P = CreateObject("DTS.Package")
With P
.LoadFromStorageFile FilePath, ""
'for local database, using trusted connection
.SaveToSQLServer "(local)", , ,256
End With
Set P = Nothing

End Sub

"Craig Buchanan" <someone (AT) somewhere (DOT) com> wrote

Quote:
I would like to import a DTS package that has been saved as a BAS module
into MSDE from within a VBA script. Is this possible?

Thanks for your time.

Craig Buchanan




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.