SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Connection String Expression Syntax


Connection String Expression Syntax

Author
Message
dan-572483
dan-572483
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1423 Visits: 1999
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?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28641 Visits: 13268
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?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
dan-572483
dan-572483
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1423 Visits: 1999
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search