Connection String Expression Syntax

  • 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?

  • Try this:

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

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

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • 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.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply