Re: Changing connection information on OLEDB connection
- From: "Kayda" <blairjee@xxxxxxxxx>
- Date: 3 Feb 2007 21:32:27 -0800
I actually tested this out using Crystal Reports and it is a Sybase
OLEDB issue. Even though the IP address is defined differently in both
Sybase OLEDB datasources, it seems to cache one connection so, even
though you select the other connection, it uses the previous one. Even
though this is now off topic, any ideas as to why this is happening
would be appreciated. I can't use ODBC in SSIS because it looks like I
cannot set the query using a variable with an ODBC source. So I'm not
sure what I am going to do yet.
Thanks,
Kayda
On Feb 3, 2:43 pm, "Kayda" <blair...@xxxxxxxxx> wrote:
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:
- Re: Changing connection information on OLEDB connection
- From: Allan Mitchell
- Re: Changing connection information on OLEDB connection
- References:
- Changing connection information on OLEDB connection
- From: Kayda
- Re: Changing connection information on OLEDB connection
- From: Allan Mitchell
- Re: Changing connection information on OLEDB connection
- From: Kayda
- Changing connection information on OLEDB connection
- Prev by Date: Re: Should I use SSIS?
- Next by Date: Re: Changing connection information on OLEDB connection
- Previous by thread: Re: Changing connection information on OLEDB connection
- Next by thread: Re: Changing connection information on OLEDB connection
- Index(es):
Relevant Pages
|