Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, August 17, 2016 4:51 PM
Points: 622, Visits: 1,935
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


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 15,289, Visits: 13,074
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1507313
Posted Tuesday, October 22, 2013 3:10 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, August 17, 2016 4:51 PM
Points: 622, Visits: 1,935
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