SSIS FlatFile Access via Jet - ssis

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

Related

SSIS Lookup to Excel file causes export to excel destination to fail

I have an SSIS package that is all tested and working fine except for one part. When I try to export data to an Excel file that was previously used in a Lookup function, it returns this error:
[Excel Destination 1 [3340]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E09.
I have tried copying the file and then exporting the data to the copy and it works fine - it only fails when exporting to the same file used in the lookup. I have a feeling that the Lookup function uses the OLE DB connection that I've created for it and leaves it open, so that when the Excel Connection Manager tries to access the file to write on it, it is denied.
I've tried altering the OLE DB connection to the Excel file to be read-only, and to use full cache and no cache on the Lookup, but none of this has helped. Appreciate any suggestions.
I do believe your assumption is correct, SSIS is taking an exclusive lock on the Excel file when it opens and isn't sharing that lock with itself. A quick rework would be to add a second SSIS package. This one populates a Cache Connection Manager with all of the Excel data. Persist the cache file to disk
Then in your existing SSIS package, change the Lookup to use the cache file instead of Excel directly. Now the only lock taken should be for the Excel Destination.
You then would need to make your invocation pattern
RunNewCachePackage
RunNormalPackage

SSIS MySQL Copying Table to SQL Server

I want to copy tables from MySQL to SQL Server.
ADO.NET source using the MySQL connection.
OLE DB destination, SQL Server.
The statement is a full copy so no big deal there. When I hit the play button, after a while an error pops up. I set a DataViewer and started all over again, running it from inside the DataFlow while checking the DataViewer. After a while (this time it took longer) the error.
Error: 0xC02090F5 at Data Flow Task, ADO NET Source 1: The component
"ADO NET Source" (1) was unable to process the data. Fatal error
encountered during data read.
Error: 0xC0047038 at Data Flow Task,
SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The
PrimeOutput method on component "ADO NET Source" (1) returned error
code 0xC02090F5. The component returned a failure code when the
pipeline engine called PrimeOutput(). The meaning of the failure code
is defined by the component, but the error is fatal and the pipeline
stopped executing. There may be error messages posted before this
with more information about the failure.
Any idea on this error?
this took me few days to figure out...so I thought I would share my notes
How to connect and load data from MySQL to SQL Server
1 - Download the 32 bit ODBC driver.
go to the MySQL website and download: “mysql-connector-odbc-5.2.4-ansi-win32.msi” NOTE: Do not use the 64 bit driver on BIDS 2008. BIDS 2008 is 32 bit. You will get a mismatch error when creating SSIS’s connection manager: “The specified DSN contains an architecture mismatch between the Driver and Application”
2 - Create a User DSN You need to open the using windows 32 ODBC admin tool. DO NOT open the regular ODBC admin, in control panel. Open the ODBC admin located here: c:\Windows\SysWOW64\odbcad32.exe. If you use the default ODBC admin…it will not work. Additionally you must create a “User DSN” - NOT a System DSN. Otherwise it will not show up in SSIS NOTE: the screens look the same so you will have no way of knowing whether you are in 32 BIT ODBC Admin tool or not.
3 – Create a new SSIS package and create an ADO.NET connection manager AND ADO.NET SQL Server destination.
4 – Change the Source ADO.NET properties. You will get validation errors and your package will not run. You need to change the “ValidateExternalMetadata” to FALSE (in the “Advanced Editor” dialog box) of the ADO.NET source It will also give you metadata error…that’s ok…just click ok. It will still pull the metadata (column names/data types). You cannot select the tables as you would in SQL server. You need to type the SQL select statement.
5 - Run the package and should run and load normally.

"Unspecified Error" when clicking on 'Name of Excel Sheet' for a Excel Source Task

I've created an Excel connection. When I create a data flow with an Excel destination and click 'Name of Excel Sheet' I get an "Unspecified Error". When I look under 'Show Advanced Editor' of the destination I see the following error:
Error at blah [Connection manager "DestinationConnectionExcel"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unspecified error".
Error at Insert blah [Destination - blah [199]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "DestinationConnectionExcel" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Exception from HRESULT: 0xC020801C (Microsoft.SqlServer.DTSPipelineWrap)
I've read through a tons of other post and nothing seems to help. I've tried setting the 'DelayValidation=True' on all the Jet Engine related task. While this allows me to run the package without any errors, I can't edit or change anything. I also can't create new tasks with Excel.
I've already tried to set 'Run64BitRuntime = false" and that also isn't helping.
Another note, The problem is intermittent. I've been able to work with Excel tasks fine one time after a reboot, then another time its all failing as I described.
Any help would be appreciated. Thanks all
I encountered a similar issue, and the resolution was two-fold for me. First, make sure certain dlls are properly registered on your dev machine:
Paraphrased from SSIS 2005: Using Execute SQL Task to work with Excel Connection Manager
Please check whether the following files exist:
C:\windows\system32\odbcjt32.dll
C:\windows\system32\msjet40.dll
C:\windows\system32\msexcl40.dll
C:\Program Files\Common Files\System\Ole DB\oledb32.dll
C:\Program Files\Common Files\System\ado\msado15.dll
If they are, please manually register them. Run each of the following commands from command prompt:
Regsvr32 "C:\Program Files\Common Files\system\Ole DB\oledb32.dll"
Regsvr32 "C:\Program Files\Common Files\system\ado\msado15.dll"
Regsvr32 "C:\windows\system32\msjet40.dll"
Regsvr32 "C:\windows\system32\msexcl40.dll"
Then, update any folder/file paths referenced in the SSIS package. I kept changing the Excel Connection Manager object to point to the correct file, but the change would never "stick." Another developer directed me to look at the list of Variables in the SSIS package. Right-click anywhere in the package designer and choose "Variables" (based on the 2008 version). In the list of variables, check if there are any paths that are being used. If you find any, verify that they exist on your machine or change them to use your own local paths.
After following these two suggestions, I was able to open the Excel file and choose the target sheet in the Excel Connection Manager window. And, the SSIS package runs successfully in my local environment.
I take it the path to the excel workbook is correct? I also had problems when I had opened and saved the excel workbook I was using as my destination in excel. I think if you create the workbook from within SSIS it might use office web tools. Perhaps you could try to recreate the workbook within SSIS.
I got similar problem,make sure connection manager is connected to MicrosoftExcel-64 bit which is same as SQL SSIS version.
Otherwise add Microsoft.ACE.OLEDB.12.0 provider in your linked server, not in your local machine.
And also check if you have Microsoft excel present in your server again not on your local machine
If local machine and SQL Server installed on the same machine then its fine.

Cannot loop through Excel 2003 files in SSIS 2008

I am trying to execute a SSIS 2008 package on a 64-bit OS and import Excel 2003 files to SQL Server 2008.
I have created an OLEDB Connection to the Excel file with a Connection String that retrieves the Excel file from a variable, inside the ForEach Loop Container.
The Run64BitRunTime is set to false.
I am not able to edit the SQL Command on the OLEDB Source in the Data Flow task. It returns an error :
Error 2 Validation error. Load List Staged Table: Load List Staged Table: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "List OLEDB to Excel" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed. 0 0
Appreciate any help.
Check this out:
http://dougbert.com/blogs/dougbert/archive/2008/06/16/excel-in-integration-services-part-1-of-3-connections-and-components.aspx
I've had problems with excel on 64 bit systems - You'll have to run the 32 bit dtexec for the job. Why you are getting errors inside BIDS, I don't know.
Yes, I am running BIDS on a 64-bit OS.
I resolved the issue by using an Excel Connection Manager in the Control Flow and an Excel source in the Data Flow Task instead of the OLEDB source and assigning a default workbook name to the variable. I also made changes to the data access mode in the Source editor.
Thanks for the response.

ASP Weird Unspecified Error - 80004005

I had to work on an already made website, just adding some small module
While i was updating, there was many files called myDB.mdb in the different subfolders
i wanted to make sure that my app is connecting the right database
so i started renaming subfolder...at one of those subfolders, i refreshed,the main site and mine stopped working
i renamed back to the correct name.. refresh... refresh... refresh.. i am still refreshing and i started another browser.. it is giving a connection problem :S
Provider error '80004005'
Unspecified error
/new/conn.asp, line 13
any idea about his :S
would appreciate any help !
I have had the same problem. The first time I loaded a page it worked well, but if I loaded the page again quickly, then I got this error. If I waited for a while then I didn't get the error. It must be because when you call objConnection.Close it takes some time to actually close the mdb file, so if you try and open it again you get the "File already in use type error". Strangely adding a mode to the connection sorted this problem out for me. It doesn't have to be read only, read / write works as well.
objConnection.Mode = 1 ' read only
Microsoft OLE DB Provider for ODBC
Drivers error '80004005'
[Microsoft][ODBC Microsoft Access
Driver] The Microsoft Jet database
engine cannot open the file
'(unknown)'. It is already opened
exclusively by another user, or you
need permission to view its data.
or
Microsoft OLE DB Provider for
ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access
Driver] '(unknown)' isn't a valid
path. Make sure that the path name is
spelled correctly and that you are
connected to the server on which the
file resides.
or
Microsoft OLE
DB Provider for ODBC Drivers error
'80004005' [Microsoft][ODBC Microsoft
Access 97 Driver] Couldn't use
'(unknown)'; file already in use.
From: http://tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors.html
Whatever happened, it is resulting in an 80004005 error, so the problem is definitely a permission issue.
Depending on the configuration of the web server, it may not be the IUSR account that needs the access. I find it's best to fire up FileMon, filter it to the name of my database (with wildcards), and check out the properties of the error that shows up. Viewing the properties will show you the user that is actually trying to access the file.
For Access databases, you want to make sure that you're modifying the permissions of the folder and not the file. You'll need Modify permissions on the folder so that the .ldb file can be created.
Check that the IUSR account has permissions on the Access database and the folders/sub-folders containing it. I've found that on occasion if you rename or compact an access database it loses IUSR priviledges so appears in use / locked
I had the same error on Access DB :
Provider error '80004005'
Unspecified error
Reason was that one of the pages included files was not in the right format (UTF-8) but ANCI
When I changed that file to UTF-8 , everything woked right !
greeting otto
Googled in but the issue was spaces in the filename for my situation. Remove them and no problems. I hope that will help someone else.