dbTalk Databases Forums  

Connection variables by rowset

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


Discuss Connection variables by rowset in the microsoft.public.sqlserver.dts forum.



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

Default Connection variables by rowset - 02-06-2004 , 02:01 AM






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

The error says it doesn't load the data source. why?

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Connection variables by rowset - 02-06-2004 , 02:36 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


"DTS beginner" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I've treid to assign connection variables by rowset. ie.

Dim oConn
Dim oRS

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 connection
oConn.DataSource = oRS.Fields(0).Value

The error says it doesn't load the data source. why?



Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: Connection variables by rowset - 02-06-2004 , 02:36 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

"DTS beginner" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I've treid to assign connection variables by rowset. ie.

Dim oConn
Dim oRS

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 connection
oConn.DataSource = oRS.Fields(0).Value

The error says it doesn't load the data source. why?



Reply With Quote
  #4  
Old   
DTS beginner
 
Posts: n/a

Default Re: Connection variables by rowset - 02-06-2004 , 03:21 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.


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.