all groups > sql server dts > february 2004 >
You're in the

sql server dts

group:

Connection variables by rowset


Connection variables by rowset DTS beginner
2/6/2004 12:01:05 AM
sql server dts: I've treid to assign connection variables by rowset. ie.

Dim oCon
Dim oR

Set oRS = DTSGlobalVariables("RSTables").Value ' This is the output para. of "select source_server from table
Set oConn = DTSGlobalVariables.Parent.Connections("Sybase ASE OLE DB Provider") ' This is the source connectio
oConn.DataSource = oRS.Fields(0).Value

Re: Connection variables by rowset DTS beginner
2/6/2004 1:21:07 AM
The error says it cannot load the data source.

I can fix it by trim the rowset value ie. Trim(oRS.Fields(0).Value)

Thanks anyway.
Re: Connection variables by rowset Allan Mitchell
2/6/2004 8:36:00 AM
Is that definitely the name of your connection?

What is the exact error?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

Re: Connection variables by rowset Darren Green
2/6/2004 8:36:09 AM
What is the fuull error, and what line of code does it get raised on?

If it is reading the field value -

Have you checked the value of oRS.Fields(0).Value

Try adding a debug message box-

MsgBox oRS.Fields(0).Value
oConn.DataSource = oRS.Fields(0).Value


--
Darren Green
http://www.sqldts.com

[quoted text, click to view]

AddThis Social Bookmark Button