Re: Changing connection information on OLEDB connection
- From: "Kayda" <blairjee@xxxxxxxxx>
- Date: 3 Feb 2007 01:43:54 -0800
I did that and the variable is setting ok-it does change with each
loop. You can set the password property of an OLEDB connection with an
expression it seems--only ServerName, UserName and InitialCatalog. I
will try setting those dynamically (keeping password static) and see
what happens then. I will keep you posted.
Kayda
You can set all connection properties
On Feb 3, 4:18 am, "Allan Mitchell" <a...@xxxxxxxxxxxxxxxxxx> wrote:
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 Mitchellhttp://wiki.sqlis.com|http://www.sqlis.com|http://www.sqldts.com|http://www.konesans.com
"Kayda" <blair...@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:
- Changing connection information on OLEDB connection
- From: Kayda
- Re: Changing connection information on OLEDB connection
- From: Allan Mitchell
- Changing connection information on OLEDB connection
- Prev by Date: Re: Stored Procedure not working in Execute SQL Task
- Next by Date: Re: Dtsx and Fuzzy Lookup Bug ?
- Previous by thread: Re: Changing connection information on OLEDB connection
- Next by thread: Re: Changing connection information on OLEDB connection
- Index(es):
Relevant Pages
|
Loading