oledb

How to insert a CLOB using OleDb

Could someone post some sample code showing how to insert text greater than 4000 characters in length into an Oracle 10g CLOB field? I am using the Oracle OLEDB provider and ATL in C++. My naive attempt returns the error 'ORA-01704: string literal too long' whenever the text I am attempting to insert goes over 4000 characters in length. ...

In C# how to access excel headers using OLEDB (without Automation)?

This is my code where I am trying to access first row, first column string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + fileName + @";Extended Properties=""Excel 8.0;HDR=NO;"""; string CreateCommand = "SELECT * FROM [Sheet1$]"; OleDbConnection c...

Update Excel 2007 with OleDb

Attempting to execute an update command against an Excel 2007 file gives the error: Operation must use an updateable query. I'm using System.Data.OleDb with a connection string like this: Dim strConn As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=""" & pathToFile & """;" & _ "Extended Properties=""Excel 12.0;H...

OleDB not supported in 64bit mode?

I've been using Microsoft.Jet.OLEDB.4.0 and Microsoft.ACE.OLEDB.12.0 to read in .csv, .xls, and .xlsx files. I just found out that neither of these technologies are supported in native 64bit mode! I have 2 questions: What is the supported way to programatically read .csv, .xls, and .xlsx files in 64 bit mode. I just can't find answe...

What is the best and fastest way to write into Excel file using C#?

I am trying to write into excel file using OLEDB (without automation). I have around 500 rows of data which I get from some other application and then write into Excel file one by one using 'INSERT INTO..' Query. I am sure that there is no delay in reading data from the other application. I checked that. The total time taken to write int...

reading dbase file without standard .dbf extension.

I am trying to read a file which is just a dbase file but without the standard extension the file is something like: Test.Dat I am using this block of code to try and read the file: string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Temp;Extended Properties=dBase III"; OleDbConnection dBaseConnect...

How do I concatenate two strings with the Jet.OLEDB.4.0 provider

I'm passing a query to an internal application that runs that query and returns the result, the connection is to a CSV file and I'm connecting with the Provider=Microsoft.Jet.OLEDB.4.0 I'd like to join to strings in to one column but I'm getting an error. Can this be done, does anyone know how to do it? Example of what I'm doing: sel...

Xml output parameter in OLEDB?

I have a sproc which looks like that: CREATE PROCEDURE xyz ( @param1 int, @param2 int, @param3 xml OUTPUT ) I'm trying to access it using OLEDB: DEFINE_COMMAND_EX( Accessor, _T( "{ ? = CALL xyz( ?,?,? ) }" ) ) BEGIN_PARAM_MAP( Accessor ) SET_PARAM_TYPE(DBPARAMIO_OUTPUT) COLUMN_ENTRY(1, _result) SET_PARAM_TYPE(DBPARAMIO_INPUT) COL...

how to match table value to a text box value using c#

This is code for select user password where id = 1 ; I want to match this value to a text box. If the value is a match then second window form will be open. But it is not working ... OleDbConnection con = new OleDbConnection(database2.conn); con.Open(); OleDbCommand OCom = new OleDbCommand("select user_pasword from tblpasword where id...

Excel cell-values are truncated by OLEDB-provider

Hi folks, I'm using the OleDbConnection class to retrieve data from an Excel 2000/2003 workbook: string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filename + ";" + "Extended Properties=\"Excel 8.0;IMEX=1\";"; OleDbConnection connection = new OleDbConnec...

Using OLEDB / Microsoft Jet driver causes "Number stored as text" in excel file

I'm having a problem using OLDEDB from C# to write entries into an excel file. Essentially I want to use an excel template file for formatting some information. The idea is that users can run a query, it'll populate the results into an excel file, where the user can then continue to use excel to maniulate the results. To do this, I crea...

Visual Studio 2005 - OleDbConnection throws "Invalid authorization specification" in Form Designer, how to avoid supplying a username/password?

I have a form with an OleDbConnection object on it. This form fails to load in the Form Designer with the message: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Invalid authorization specification ...

Detect time of last change on a Microsoft Access database table

Does anyone know of a way to detect when the last time a Microsoft Access table has been changed (inserted into or updated)? We used OLEDB via ADO COM to communicate with an access database programmatically and were looking for a way of detecting changes to specific tables. We don't need to know what those changes are, just that change...

When should I be using Odbc, OleDb, SQLClient? What are the trade-offs

I am starting off with a SQLServer database. So it would seem that I should use System.Data.SqlClient namespace. But, there is a chance that we might shut down our SqlServer database and go to MySql or Oracle. For this reason, I am coming up with a set of standards on how our .Net apps will communicate with the database, so as to make it...

Error reading from Excel in C#: "...could not find the object..."

I have more or less exactly the same error as in this post, but that solution has not solved my problem. The error message I get: The Microsoft Office Access database engine could not find the object 'Adresser$'. Make sure the object exists and that you spell its name and the path name correctly. I have checked and double-checked th...

oledb not registerd on your local machine

I am using OLEDB to connect .mdb/.accdb file. I am writing code like this using System.data.OLEDB; class dbconne { ..... ......... ....... . . . . OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db1.mdb"); OleDbCommand aCommand = new OleDbCommand("select * from emp_test", aConnect...

Migrating from MS SQL to MySQL: SQLOLEDB? Migration kit login error?

I've been put in charge of migrating a customer's website of MS SQL/ASP to PHP/MYSQL. I have zero experience with MS SQL. I'm trying to figure out the best way to get the current data migrated to MySQL so I can begin PHP development. Some details: I downloaded SQL Server Mangement Studio Express. I found the following string in...

Stored Proc returns a Cursor, how to handle this using OLEDB in C#

Hello, I am using OLEDB driver to call a Stored Procedure in Oracle DB. The Stored Proc returns a cursor as the output. I am able to call this Stored Proc using Oracle Data Source (System.Data.Oracle.OracleCommand), However I do not know how to call this SP using the OLEDB data source. Any help on how to specify the SP is returning a cur...

Extract OLE Object (pdf) from Access DB

We are upgrading/converting several old Access databases to MS-SQL. Many of these databases have OLE Object fields that store PDF files. I'm looking for a way to extract these files and store them in our SQL database. I've seen similar questions that answer how you might do this with image files (jpg, bmp, gif, etc) but I haven't found ...

.NET: How to change the value in a DataTable

In ADO.NET i'm using GetSchemaTable to return the schema table for a results set. DataTable schema = rdr.GetSchemaTable(); gridSchema.DataSource = schema; gridSchema.DataBind(); Unfortunatly the "ProviderType" value is displaying as an integer, rather than the OleDbType enumeration value that it is: ProviderType Desired Display ...