SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DTS ActiveX to SSIS 2008 ActiveX Script


DTS ActiveX to SSIS 2008 ActiveX Script

Author
Message
Harjiv Kochhar
Harjiv Kochhar
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 154
Hi,

Im trying to create an MS Access database (.mdb ) on the fly with the following script in SSIS(2008) ActiveX Script task but DTSGlobalVariables.Parent.Connections is not supported need help with changing to an equivalent in SSIS 2008 or something that works. This script works in DTS packages.

Option Explicit

Sub Main()

Dim sFilename
Dim sConnectionString
Dim oCatalog
Dim oConn
Dim oFSO

' Derive new filename - X:\Source_FST\Export_yyyymmdd.mdb
sFilename = DTSGlobalVariables("Source_FST").Value & "Export_" & Year(Date) &_
Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & ".mdb"

' Check for existing instance of file and delete
Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.FileExists(sFilename) Then
oFSO.DeleteFile sFilename
End If
Set oFSO = Nothing

' Create empty MDB
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sFilename
Set oCatalog = CreateObject("ADOX.Catalog")
oCatalog.Create sConnectionString
Set oCatalog = Nothing

' Get reference to Access Connection and set new filename
Set oConn = DTSGlobalVariables.Parent.Connections("Microsoft Access")
oConn.DataSource = sFileName
Set oConn = Nothing


Main = DTSTaskExecResult_Success
End Sub


Thank you.
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10696 Visits: 4894
Duplicate post.

http://www.sqlservercentral.com/Forums/Topic1167066-148-1.aspx

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Harjiv Kochhar
Harjiv Kochhar
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 154
Not really, this issue is something different and I searched all ssis forums for an answer before posting. Thanks.
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10696 Visits: 4894
harry.sh16 (8/31/2011)
Not really, this issue is something different and I searched all ssis forums for an answer before posting. Thanks.


You should probably post in the SSIS Forum. :-)

Do either of these articles help?

http://www.freevbcode.com/ShowCode.asp?ID=5797

http://www.bigresource.com/MS_SQL-How-to-create-an-Access-database-from-ssis-w4NEiUHv.html

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search