What is causing my OLEDbException, IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

I apparently was mistaken when I said the query did not contain any reserved words. The query I was using was selecting from another query in the Access Database. That other query had a reserved keyword that was causing the problem. BTW: The Access database engine runs in different modes, depending on whether it is … Read more

SSIS Package Not Running as 32bit in SQL Server 2012

By default, everything will run in 64 bit on the servers. To change this behaviour, you need to indicate that the 32bit version of dtexec should be used. For the 2012 SSISDB, we have two easy ways of invoking our packages: SQL Agent and the catalog.start_execution method. catalog.start_execution For single serving package runs, you can … Read more

JSON.net serialize directly from oledbconnection

Firstly, you should stop serializing to an intermediate string and instead serialize directly to the HttpResponse.OutputStream, using the following simple methods: public static class JsonExtensions { public static void SerializeToStream(object value, System.Web.HttpResponse response, JsonSerializerSettings settings = null) { if (response == null) throw new ArgumentNullException(“response”); SerializeToStream(value, response.OutputStream, settings); } public static void SerializeToStream(object value, TextWriter … Read more

Help with a OleDB connection string for excel files

Unfortunately, you can’t set ImportMixedTypes or TypeGuessRows from the connection string since those settings are defined in the registry. For the ACE OleDb driver, they’re stored at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Excel in the registry. So, you can simplify your connection string to: conn.ConnectionString = @”Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Nick\Desktop\Pricing2.xlsx;Extended Properties=””Excel 12.0 Xml;HDR=Yes;IMEX=1;”””; Once you set TypeGuessRows to 0 and … Read more

Parsing CSV using OleDb using C#

You should indicate only the directory name in your connection string. The file name will be used to query: var filename = @”c:\work\test.csv”; var connString = string.Format( @”Provider=Microsoft.Jet.OleDb.4.0; Data Source={0};Extended Properties=””Text;HDR=YES;FMT=Delimited”””, Path.GetDirectoryName(filename) ); using (var conn = new OleDbConnection(connString)) { conn.Open(); var query = “SELECT * FROM [” + Path.GetFileName(filename) + “]”; using (var adapter … Read more