Re: Changing connection information on OLEDB connection
- From: "Allan Mitchell" <allan@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Feb 2007 23:18:20 +0000
OK so this is SSIS
On the face of it this looks OK.
What I would do is set a breakpoint on the "On Each Iteration Of The Loop" event.
I would then set a watch on the variable to make sure that the connection string is being set properly.
What I might do is have a variable called cnString that is "EvaluateAsExpression" = true. I would build the string in there and simply watch this variable.
Also. Can you not set the ServerName, UserName and Password properties individually?
--
Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com
"Kayda" <blairjee@xxxxxxxxx> wrote in message news:1170385365.762151.167240@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
I am trying to set the connection string in a connection manager at
runtime. Here is what I have done:
1. Created a gv_DataSource, gv_Username and gv_Password
2. Created a ForEach Loop that reads DataSource, Username and password
values from a variable (it is an For Each ADO loop Enumerator). The
ADO recordset is read into by an Execute SQL task before the loop.
3. Mapped values from the recordset to variable in the ForEach loop's
"Variable Mappings" page.
4. Used the variables in my Sybase OLEDB Connection Manager's
"Expression" property, setting the "ConnectionString" property to:
"Data Source=" + @[User::gv_DataSource] + ";User ID=" +
@[User::gv_Username] + " ;Password=" +
@[User::gv_Password] + ";Initial
Catalog=b=MydatabaseName;Provider=Sybase.ASEOLEDBProvider.2;Persist
Security Info=True;"
5. I set the values in my database table for the connection-I set 2
connections for which I have Sybase OLEDB datasources setup.
When I run the package, I just get the first server's data twice, it
doesn't set the second server's data during the second loop. I made
sure the first one was working (i.e. the ConnectionString's property
was being set by the data from the current variables) by setting the
variables incorrectly in the variable properties page, and then
running the package. So the first row of connection information is
working, but the second loop around it doesn't seem to be working. I
used a msgbox in a script task to show that the variables are mapping
correctly in the loop, so it seems the second time around the
connection information isn't taking from the variables.
What am I doing wrong here?
Thanks,
Kayda
.
- Follow-Ups:
- References:
- Prev by Date: Re: Insert into Excel file
- Next by Date: Re: DTS - Insert Process Date into Excel File?
- Previous by thread: Changing connection information on OLEDB connection
- Next by thread: Re: Changing connection information on OLEDB connection
- Index(es):
Relevant Pages
|
Loading