oledb

Binding parameters to OLEDB command throws error.

Hello fellows, I am using AS 400 OLEDB with .NET. It uses '?' instead of '@param to bind parameters with a command Now there is a situation where the command is like SELECT ... FROM (SELECT ... ROW_NUMBER() OVER(ORDER BY ColumnName) as RowNum FROM Employees e ) as DerivedTableName WHERE RowNum BETWEEN @startRowIndex ...

Reading an Access Query from Visual Studio 2010 (VB.NET)

I have a database in access and one of the fields is 'Is Quick'. I have a query that filters all of these out. How would I get the data from that query in Visual Studio 2010 (Express). VB code please. ...

Access Windows Search index using ASP.NET MVC

I'm on a project that is being upgraded from vbscript to ASP.NET MVC. It used Microsoft Index Server to index Word and PDF files on a Windows Server 2003 machine. It simply opened an OleDbConnection using a connection string like "Provider=\"MSIDXS\";Data Source=\"docSearch\";". After researching a bit, I learned that Index Server is ob...

OleDb Object Invalid or No Longer Set

I'm trying to read an excel file using an OleDb Reader, I couldn't debug the code because this error only comes out on a production server. It really doesn't make sense to me, could anyone help me? From the logs the error comes out as: System.Data.OleDb.OleDbException: Object invalid or no longer set. at System.Data.OleDb.OleDb...

OleDB & mixed Excel datatypes : missing data

I have an Excel worksheet I want to read into a datatable - all is well except for one particular column in my Excel sheet. The column, 'ProductID', is a mix of values like ########## and n#########. I tried to let OleDB handle everything by itself automatically by reading it into a dataset/datatable, but any values in 'ProductID' like ...

Can we replace our ODBC import with an OLEDB import?

I'm looking for some advice/information from people far more familiar with database connectivity technology than I am. Currently our app allows the user to select any ODBC dsn on their machine, choose a table and optionally specific columns from the table and import them into our app using ODBC. In our new version we are creating a 64 b...

Strange OLEDB Excel Export Issue

I've written a program to generate an Excel Workbook in C# using OLEDB. Mostly working, but one thing I've noticed is that if I output only 1 column, it leaves a blank row after the header. Any ideas? ...

OleDB/Access inserting into Date/Time field with a future date

Hi, I am writing a VB.NET application that uses OleDB to connect to an Access database. I want to insert a date that is in the future (it is chosen with a DateTimePicker) into the database. When I chose a date that is today (Jul 15, for example) or in the past it works fine. Whenever I choose a date that is in the future, it crashes. Is...

Is there a way to create an Access Database (.mdb) file without using the MS Jet OLE DB provider?

After usually creating databases with this: http://support.microsoft.com/kb/317881 it appears some registry cleaners wipe out the OLEDB entries, and therefore the service provider (Jet 5.0) cannot be found. Is there a way around this? I'd like to be able to create a database without playing the "ship an empty DB and copy it around when...

OLEDB JET error in Vista & Windows 7, not in XP.

I wrote an application with VS2008 on Windows XP, and produced an .EXE file. This application will only run on Windows XP OS. It fails on Vista and Windows 7. It gives an error saying that a Microsoft OLEDB JET 4.0 occurred. I use Microsoft Access as a db in this app. What should I do? ...

how to read an excel file that is readonly from c#?

I am trying to do that by using OleDb but the file is protected by a password which i dont have. So it gives the following error when i open the connection: Cannot update. Database or object is read-only. How can i solve this? thanks ...

excel columns selection query in C# winform

I am trying to match a date from a column in excel sheet whose column type is DateTime. using following query DateTime dtNew = Convert.ToDateTime("7/16/2010"); OleDbDataAdapter da = new OleDbDataAdapter("Select * FROM [" + SheetName + "$] where [Hand off date] = '" + dtNew + "'", conn); I am getting Datatype mismatch in criterion...

Windows x64 C# x86 console application exe seems to work with "DLL any CPU" Any potential problem ?

My computer runs Windows 7 X64 Enterprise Edition. I need x86 mode for my executable as I use Visual Foxpro OLEDB driver. I thought it was required to compile library DLLs which are used by this exe as "X86". However, DLLs compiled with "Any CPU"seem to work which is quite convenient as they are used somewhere else and no need to main...

How to rename an Excel worksheet using OLEDB, ODBC or something else, other than an instance of Excel?

I am needing to rename an Excel worksheet that comes to us via FTP. The server the sheet resides on does not have Excel running on it so trying to script it via WSH and vbscript using Excel.Application is out of the question. Is it possible to rename an Excel worksheet via OLE DB, ODBC or some other mechanism? ...

Use Enterprise library for OLEDB Access database

Hi All, I want to use Microsoft Enterprise library Data Application Block for MS Access database (OLEDB provider) I want parameter based INSERT functionality with enterprise library (Just like we do for SQL provider with parameter based code like - database.params.Add("@EmpName", this.EmpName); I want the same thing for MS Access data...

Inserting not commited to database

I'm having some trouble getting my DataSet to work. I have a MDB-Database in the background and created a DataSet out of it. Now I created a new method that lets me create a new user in the table. But when I call it, nothing happens. No exceptions, no errors and I even get "1" returned as number of affected rows. But when I look in the...

Unusual OleDbException: ?~¿????x(?(?? when connecting to Oracle 10g database, what would be the cause?

I'm working with a legacy application that uses OleDB to connect to an Oracle10g database. One customer is getting these exceptions being reported quite often: System.Data.OleDb.OleDbException: ?~¿????x(?(?? at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data...

OleDB not saved to databse file

I have an MDB file I access using OleDB: OleDbConnection connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database.mdb;Persist Security Info=True"); And try to create a new row in a table Users: connection.Open(); OleDbCommand cmd = new OleDbCommand("INSERT INTO `users` (`name`, `password...

what are the differences between OLEDB and ODBC?

Currently I can connect to a local .mdb with an Oledb connection. I am able to query, add, update and delete the database with correct results. How would connecting to an ODBC database differ in terms of c# usage from an Oledb database? ...

OLE DB Driver Help

I'm using Delphi 2006 and would like some help with fixing a bug in an OLE DB driver implementation. The implementation is built on top of the OLEDB Toolkit from Binh Ly. The problem I'm having is that after executing an Insert command inside the TOleDbCommand.ExecuteCommand method I need to update the row data with a record Id (this i...