Is there a way to access FlatFiles with the Microsoft.Jet.OLEDB.4.0 driver in SSIS ?
The acces via the FlatFile Source is much better, it´s just about if there exists a way to do it with the Jet driver.
Is there a way to access FlatFiles with the Microsoft.Jet.OLEDB.4.0 driver in SSIS ?
The acces via the FlatFile Source is much better, it´s just about if there exists a way to do it with the Jet driver.
This seemed an interesting question so I piddled around a bit with it. Yes, you can definitely use the JET driver to read a flat file. HOW TO: Use Jet OLE DB Provider 4.0 to Connect to ISAM Databases See Open Text section
By default, it expects the file to be a CSV but you can specify the formatting in a Schema.INI which would be in the same folder as the connection manager is pointing to.
One thing to note about the CM, it points to the folder of the text files, not a particular file.
When you create your Connection Manager, you will need to go into the All tab (after selecting the Native OLE DB\Microsoft Jet 4.0 OLE DB Provider) and then add Extended Properties. I was able to make it work with a FMT of CSVDelimited and just Delimited (as my sample file was a csv).
Exchanging the commas for tabs in the source file and setting the FMT at TabDelimited did not appear to work in the connection manager property but I did not try creating a schema.ini file as the BOL article indicated.
You cannot define all characteristics of a text file through the connection string. For example, if you want to open a fixed-width file, or you want to use a delimiter other than the comma, you must specify all these settings in a Schema.INI file.
The full value of the ConnectionString on my CM is below
Data Source=C:\tmp\so\;Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties="text;HDR=Yes;FMT=CSVDelimited;";
If the package works fine at design time but goes belly up once it runs, the JET driver is only available as 32 bit so on a 64bit machine as the error message would indicate.
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "OLEDB_JET" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
The solution to this is to run it from the command-line in 32bit mode like
C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn>.\dtexec /file C:\sandbox\SSISHackAndSlash\SSISHackAndSlash\so_JetFlatFile.dtsx