oledb

Using ADO or OLEDB with ATL

I am writing an class using C++ (ATL).. I need to connect to a database. I am familiar with ADO but I see that all the functions are using IDispatch (late-binding/Automation). I am considering using OLEDB instead. What are the pros and cons of each? OLEDB seems like a lot of maintenance if the sql changes (tables, stored procs, etc). I d...

Custom LINQ provider for Excel spreadsheets?

Does anyone know a good custom LINQ provider to query data from Excel spreadsheets? ...

Sybase ASE character set with OLEDB .NET

Using the .NET Framework 2.0 on a computer with the LCID set to 1033, I am connecting to a Sybase ASE 12.5.4 server which has its default character set to sjis. When I retrieve fields which contain Japanese text, I must, in code, convert each field from cp1252 to cp932 to display the text properly. However, when I set the computer to L...

Visual FoxPro and VS2008 do not show all DBF records. A separate build does.

Hi, I am working on a project in Visual Studio 2008 (in vb.net). The app needs to import data from a Visual FoxPro database (dbc file). Do not ask why FoxPro. It needs to be vfp and the database is updated daily by another application; therefore, I cannot use any other database format. I connect to the database through OleDb FoxPro dri...

How do I use an ADO.NET managed provider in Excel?

I have an ADO.NET Managed Data Provider that is registered in machine.config in DbProviderFactory - It is available for use from, say, Analysis Services, so I know it is correctly registered. However, I need to be able to query the managed provider from Excel, but the managed provider doesn't appear as a choice from Data Link Properties...

How do I correctly handle CR when reading text files with OleDB

I have text files that are Tab delimited. I created a Schema.ini like so: [MY_FILE.TAB] Format=TabDelimited ColNameHeader=False Col1=id Short Col2=data Text This is the code I use to read it (C#): using (var connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\FolderToData\;Extended Properties='text;FMT=...

How to export a DataGridView to Excel format in VB.NET

I'm using OLE to connect to a database using VB.NET, and show the results in a DataGridView. I want to export the data that is in the DataGridView to an Excel format file, i.e., the user can save the content of the DataGridView as MS Excel file. ...

NHibernate + Jet Replica Database - Exception thrown when committing transaction ("a different object with the same identifier value was already associated with the session).

I have an application where we're using NHibernate and the NHibernate Jet Driver to open existing .MDB files (Access 2003 / Jet 4.0 databases), read some information and add some new records. Unfortunately we have no control over the database format - so we're stuck having to support Jet. The problem I'm facing is that when performing ...

Save in database didn't work ?! (VB.NET | OLE)

Hello ,, I used the following code to save what the user editing , the code don't give me any error code , but in the same time it don't do any thing , the data still without any new changes : Dim a As String a = comb3.Text & "/" & comb2.Text & "/" & comb1.Text Dim SavInto As New OleDb.OleDbCommand Dim ConStr A...

Error in getting Dates in database (BETWEEN Clause| VB.NET|OLE)

Hello , before a little time , I used a code to get the dates between 2 dates from the database (column with dates dd/mm/yy) , I think it works nice first time , the code is : Dim b As New Date Dim a As Integer a = Val(tx2.Text) b = System.DateTime.Today b = b.AddDays(-a) ...

Turning automatic nulls off for inserts to FoxPro tables through NHibernate using JetDriver isn't working.

I'm using NHibernate with Burrow and Fluent to shuttle data from SQLServer2005 into a directory full of FoxPro 7 dbf's. When I try to save a new record through Burrow's GenericDAO, I get an exception that boils down to "Field XXX does not accept null values," where field XXX is a NOT NULL field that is not being mapped at all because it...

Retrieve SqlCommand/OleDbCommand query after inserting parameters?

Is there any way to access the prepared statement as sent to the SQL server? Dim params(1) As OleDb.OleDbParameter params(0) = New OleDb.OleDbParameter("@ID", OleDb.OleDbType.VarChar, 50) params(0).Value = guiItemsGridView.Rows(e.RowIndex).Cells("ID").Value params(1) = New OleDb.OleDbParam...

OleDbCommand can't excute this command, Why?

I create a table named "PathTable" in a MS-Access DB. The table is like this: ------------------------------ | IP | Input | Output | ------------------------------ | 127.0.0.1 | XXXXX | YYYYYY | ------------------------------ When I programed these String CommandString = "SELECT Input, Output FROM PathTable WHERE IP = '127.0.0...

insert into sql query in wpf

Hello everyone i am new in wpf. so i have got problems with it. if you help me, i will be so pleased. thanks everyone in advance. My problem is, can not insert into name inside database in wpf. how can i fix it? my codes as follows; private void button1_Click(object sender, RoutedEventArgs e) { try { string SqlStr...

Is it possible to query an OleDB connection to find out if you must use square brackets or quotes?

Is it possible to query an OleDB connection to find out if you must use square brackets or quotes? SQL: SELECT [FullName] From [My Users] Oracle SELECT "FullName" From "My Users" MySQL: SELECT `FullName` From `My Users` ...

Problems reading in an Excel file in C#

I'm reading an Excel file with OLDB Connection using this code var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0;", fileName); var fileName = string.Format("{0}\\s23.xls", Directory.GetCurrentDirectory()); var adapter = new OleDbDataAdapter("SE...

Why does my code stop after "con.Open()"?

In my code, why does nothing execute after con.Open(). If I step through each step, it ends the Form1_Load event after "con.Open()". Imports System.Data.OleDb Public Class Form1 Dim con As OleDbConnection Dim strCon As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:\testDB.accdb" Private Sub Form1_Load(ByVal sender...

Problem with unregistered Jet 4.0 on Windows 7 64 bit

I am trying to run a program, running on the hard drive, that uses Microsoft Jet OleDB to open and get info from an MS Access database. The problem is that when I try to run the program Visual Studio gives me this error: "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine." I tried building the program to tar...

Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

I created a windows application developed in .NET 3.5 in a 32 bit Windows 2008 server. When deployed the application in a 64 bit server it shows the error "Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine ". So as a solution to this issue, i have changed the build property of the project to X86, so that it will b...

"is not a valid name" error while retrieving data from csv/txt file using oledb

I retrieving data from a csv/txt file using oledb driver ConnString = "Provider=Microsoft.Jet.OleDb.4.0; Data Source = " & System.IO.Path.GetDirectoryName(strFileName) & "; Extended Properties = ""Text;HDR=YES;FMT=Delimited""" strQuery = "SELECT * FROM [" & System.IO.Path.GetFileName(strFileName) & "]" In the last line I am getting ...