Microsoft Data Link OLE DB Properties

  • Does anyone know how to access the Microsoft Data Link OLE DB Properties using the ActiveX Script task?  I can get to the Connection properties, but I don't know how to get any further.  Specifically, what I am trying to access are the "Initial Catalog" and "Data Source" OLE DB Properties.

     

  • Add the following code to your ActiveX Script.

    With DTSGlobalVariables.Parent.Connections("[Put the Connection Name here]")

    .Catalog = 'string value e.g. "pubs"

    .Connection = 'boolean value e.g. true

    .ConnectionImmediate = 'boolean value e.g. trueTrue

    .ConnectionTimeOut = 'integer value e.g. 60

    .DataSource = 'string value e.g. "(local)"

    .Description = 'sting value e.g. "This connection is used to connect to the source server

    .ID = 'integer value e.g. 1

    .InTransaction = 'boolean value e.g. true

    .InUse = 'boolean value e.g. true

    .LastOwnerTaskName =

    .Name = 'string name e.g. "Conn1"

    .Password = 'string value e.g. "mypassword"

    .Provider = 'sting value e.g. "SQLOLEDB"

    .Reusable = 'boolean value e.g. true

    .UDLPath = 'string value

    .UseDSL = 'boolean value e.g. true

    .UserID = 'string value e.g. "sa"

    .UseTrustedconnection = 'boolean value e.g. true

    End With

    Replace the "[Put the Connection Name here]" with the name of the connection and supply the appropriate new values to the relevant properties commenting out the values you do not want to change. It is not recommanded to change some of the properties like "Name" and some of the properties are read-only.

  • Hank,

    The properties you listed are the Connection Properties, not the OLE DB Properties.  Thank you, but I already know how to access the Connection Properties (see original post).  What I am trying to access are the OLE DB Properties.

    If you make a new DTS Package and put a Connection (specifically a Microsoft Data Link connection with a UDL) and a Dynamic Properties Task into it; then open the Properties of the Dynamic Properties Task and click Add...; and then drill down into the Connection until you open up OLE DB Properties, you will see the properties I am trying to access.

     

  • Try DTSGlobalVariables.Parent.Connections("[Put the Connection Name here]").ConnectionProperties("[Put the Property Name Here]").Value

    I think this is what you are looking for


    Cheers

    Filet

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

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