dbTalk Databases Forums  

Connection Properties for ODBC connection

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Connection Properties for ODBC connection in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kayda
 
Posts: n/a

Default Connection Properties for ODBC connection - 11-07-2005 , 03:05 PM






Hi:

I need to loop through a connection setting the DSN Name, User,
Password of an ODBC connection to Sybase each time to something
different. I know how do do looping in DTS using ActiveX script tasks.

In the object model for DTS it looks like the "connection" object only
applies to OLE DB (although I've used this before to retrieve a text
data source??). What object do I use to get an existing ODBC connection
in DTS, and what are the names of the corresponding properties to set
in my ActiveX script task? Do I just get the ODBC connection by name
from the connections collection?

I couldn't find this in the BOL, plese let me know where it might be.

Thanks,
Kayda


Reply With Quote
  #2  
Old   
Wm. Scott Miller
 
Posts: n/a

Default Re: Connection Properties for ODBC connection - 11-08-2005 , 10:20 AM






Kayda:

You get connections with code like this:

Option Explicit
Function Main()

Dim oPackage
Dim oConnection

set oPackage = DTSGlobalVariables.Parent
set oConnection = oPackage.Connections("NAME OF CONNECTION")

Main = DTSTaskExecResult_Success
End Function

As for properties, right click in the white area of the package that
contains the connection you want to modify and choose Disconnected Edit...
Choose the connection you want to modify and read the settings listed on the
right. Those are the names you will use to modify each property of the
connection. E.G. oConnection.DataSource = "ServerA"

Use Disconnected Edit to find the available properties for any item in the
package.

Scott

"Kayda" <blairjee (AT) gmail (DOT) com> wrote

Quote:
Hi:

I need to loop through a connection setting the DSN Name, User,
Password of an ODBC connection to Sybase each time to something
different. I know how do do looping in DTS using ActiveX script tasks.

In the object model for DTS it looks like the "connection" object only
applies to OLE DB (although I've used this before to retrieve a text
data source??). What object do I use to get an existing ODBC connection
in DTS, and what are the names of the corresponding properties to set
in my ActiveX script task? Do I just get the ODBC connection by name
from the connections collection?

I couldn't find this in the BOL, plese let me know where it might be.

Thanks,
Kayda




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.