Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Connection String Expression Syntax Expand / Collapse
Author
Message
Posted Tuesday, October 22, 2013 1:11 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 2:35 PM
Points: 529, Visits: 1,566
I'm building a SSIS job using a foreach loop to import several MS Access files. I have the Enumerator set up for file name only because I need the filename in the target table (adding it as a derived column called "Site").

I'm at the point where the tutorials have me using the "filepath" variable to set the connection string for each interation. Since it needs a full filepath I'm trying to use something like:

'C:\Folder1\Folder2\' + @[User::Site] + '.MDB'

I've tried single quotes, double quotes and no quotes. How can I added the missing (and static) parts of a file path?
Post #1507304
Posted Tuesday, October 22, 2013 1:18 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:49 PM
Points: 13,283, Visits: 10,156
Try this:

"C:\\Folder1\\Folder2\\" + @[User::Site] + ".MDB"

I assume @[User::Site] is a string variable?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1507313
Posted Tuesday, October 22, 2013 3:10 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 2:35 PM
Points: 529, Visits: 1,566
Thanks!

Acutally, since the connection string format for ACE.OLEDB 12 is more than just the filepath the actual value I needed was

"Data Source=C:\\Folder1\\Folder\\" + @[User::Site]+ ".MDB;Provider=Microsoft.ACE.OLEDB.12.0;"

Now I'm progressing.
Post #1507385
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse