Connection Reuse

  • I want to repeatedly reuse a connection, but cannot get it work, any ideas?

    ---------THIS CODE WORKS --------------

    set LogConn = CreateObject("ADODB.Connection")

    LogConn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=(local)"

    LogSQL = "INSERT INTO MIGRATIONLOG (...) VALUES (...)"

    logConn.Execute(LogSQL)

    LogConn.Close

    set LogConn = nothing

    -------------THIS CODE DOES NOT WORK ------------

    set pkg = DTSGlobalVariables.Parent

    set LogConn = pkg.Connections("master")

    LogSQL = "INSERT INTO MIGRATIONLOG (...) VALUES (...)"

    LogConn.Execute(LogSQL) - FAILS HERE

  • This was removed by the editor as SPAM

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply