Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Connecting to SQL Server in ActiveX (DTS)

Author  Topic 

kakashi
Starting Member

7 Posts

Posted - 2005-09-01 : 01:13:46
hey guys

i have a code that looks something like this

set mySourceConn = CreateObject("ADODB.Connection")

mySourceConn.Open = "Provider=SQLOLEDB;Server=(local);Database=server_name;User Id=sa;Password=saPWD"



this works fine but the problem that i'm having is we do not want to hard code the password in the connection string.

so i was wondering if there is anyway to access the DTS Connection object from the ActiveX. i was able to get the object but it is in connection2 datatype and i am not familiar of using this datatype. Code below returned the connection2 object

'DTS_Conn is the name of the object i specified in the DTS
'DTS_Conn --> SQL Server Connection object
DTSGlobalVariables.Parent.Connections("DTS_Conn")

can i use this connection2 object to run the sql statement and get the recordset?

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2005-09-02 : 07:03:04
Hi,
Try using an execute sql task to output a rowset to a global variable. You can then instantiate a local ADODB Recordset with the global variable and use it as normal.

Mark
Go to Top of Page
   

- Advertisement -