ConnectionProperties | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

ConnectionProperties

I have an ActiveX Script task which accesses an OLE DB Connection object and I want the server name from this conenction object. I am using code DTSGlobalVariables("ServerName").Value = oConn.connectionproperties.item("Server Name") for retrieving name of the server to which a connection object (oConn) is pointing. When I saved the package. Now when I open this package and try to run the ActiveX Step, it fails giving error – "OLE DB property Server Name was not found", when I go to disconnected edit and close the window without making any modifications and try to execute this package, it executes successfully. Why is this happening? When I use "Data Source" instead, it is working fine. Does OLE DB not support ‘Server Name’ property?if so, why it works when we go to disconnected edit and then execute the step? If the connection is ODBC Driver for SQL server type, can I use ‘data source’ ?
As you are using Activex script, have you checked in relevant ActiveX forums for such reference?
Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>