SSIS FlatFile Access via Jet

Is there a way to access FlatFiles with the Microsoft.Jet.OLEDB.4.0 driver in SSIS?

Access via SourceFile Source is much better; it's easy if there is a way to do it using the Jet driver.

+3
source share
1 answer

This seemed like an interesting question, so I worked a little with him. Yes, you can definitely use the JET driver to read a flat file. HOW: Use Jet OLE DB Provider 4.0 to connect to ISAM databases . See Clear Text.

By default, it expects the file to be CSV, but you can specify the formatting in Schema.INI , which will be in the same folder that the connection manager points to.

One note about CM, this points to a folder of text files, not a specific file.

When creating the connection manager, you need to go to the "All" tab (after selecting Native OLE DB \ Microsoft Jet 4.0 OLE DB Provider), and then add advanced properties. I was able to get it to work with FMT CSVDelimited and just with delimiters (since my sample file was csv).

enter image description here

Swapping commas for tabs in the source file and installing FMT in TabDelimited did not work in the connection manager property, but I did not try to create the schema.ini file as the specified BOL article.

You cannot determine all the characteristics of a text file through a connection string. For example, if you want to open a fixed-width file, or you want to use a separator other than a comma, you must specify all these parameters in the Schema.INI file.

The full value of 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 normally during development, but it flies up as soon as it starts, the JET driver is only available as 32 bits, so an error message will be displayed on the 64-bit machine.

SSIS error code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method calls Connection Manager Error "OLEDB_JET" with error code 0xC0209303. There may be error messages posted prior to this, with additional information on why the AcquireConnection method call failed.

The solution to this is to run it from the command line in 32-bit mode, for example

 C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn>.\dtexec /file C:\sandbox\SSISHackAndSlash\SSISHackAndSlash\so_JetFlatFile.dtsx 
+3
source

Source: https://habr.com/ru/post/901719/


All Articles