Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Sun, 29 Jun 2008 08:33:10 -0700 (PDT),    group: microsoft.public.sqlserver.dts        back       


How to set the Script Manager Database Connection String   
Hi,

I am using the Script manager within SSIS to execute query. Currently
I have the connection string hardcoded. How do I tie the connection
string to the DTS package Connection Manager Connections so there is
only one place to change the connection for all Script Managers within
the package?

    Public Sub ExecuteQuery(ByVal sql As String)
'----Change this to the variable based on the Conenction manager
        connString = "Data Source=xxxo;Initial Catalog=xx;User
ID=web;Password=web01;"
        Try
            sqlConn = New SqlConnection(connString)
            sqlCmd = New SqlCommand(sql, sqlConn)
            sqlConn.Open()
            sqlCmd.ExecuteNonQuery()
            ''SaveTextToFile(DateTime.Now.ToString() + "-" + sql,
SuccessLogFile)
        Catch ex As Exception
            SaveTextToFile(DateTime.Now.ToString() + "-
UpdateI.Dtsx>>", ErrorLogFile)
            SaveTextToFile(ex.Message, ErrorLogFile)
            SaveTextToFile(sql, ErrorLogFile)
        End Try
        sqlConn.Close()
    End Sub
date: Sun, 29 Jun 2008 08:33:10 -0700 (PDT)   author:   Mo

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us