473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

connecting to access db

I'm working on a Win app and in the Data tab there are only classes for
OleDB and Sql.

I create an OleDB (Using the Microsoft OLE DB Provider for ODBC) connection
to my Access DB, but it throws the following error when I try to actually
drag a table onto the form.

"You cannot use a OLE DB provider for ODBC drivers"

Any ideas on what might be wrong?

Thanks
Rich.
Nov 16 '05 #1
1 1553
"Kavvy" <r@hfeajhjgg.gt> wrote in message news:19*******************************@40tude.net. ..
I'm working on a Win app and in the Data tab there are only classes for
OleDB and Sql.
From this I'm inferring you're using Visual Studio .NET 2002 and
therefore do not have System.Data.Odbc (added in VS 2003)
available.
I create an OleDB (Using the Microsoft OLE DB Provider for ODBC)
connection to my Access DB, but it throws the following error when I
try to actually drag a table onto the form.

"You cannot use a OLE DB provider for ODBC drivers"

Any ideas on what might be wrong?


This is correct, the OLE DB Provider does not support OLE DB-ODBC
as the underlying driver stack.

Is there any particular reason you must use ODBC? You state that
it's an Access database you are connecting to, if that's a fixed part
of your application's design, why not use the OLE DB Provider for
the native Microsoft Jet driver?

Create an OleDbConnection (et al) as you normally would, and use
this as the connection string (substituting the drive path to your .mdb
file, of course):

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mydir\myData.mdb;"

That's the vanilla connection string, if you have a user name, password,
file sharing, or other requirements the ConnectionString can grow much
more complex.
Derek Harmon
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
5
by: bill | last post by:
I am having difficulties connecting to a remote Sql server database in VB.net. Lets say my remote server is found at 255.255.255.255 and its name is MyServer. The database is called MyDatabase....
5
by: Sebastian | last post by:
I'm using the following code to connect to an access 2000 database. (with reference to adodb) Public DBvar As New ADODB.Connection() DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data...
5
by: Al | last post by:
Hi, I am looking for sample VB.net code for working with Access 97 database. I know how to work with SQL but I dont know how to read and writ into access 97. Any help is very much appreciated. ...
4
by: kthiagar | last post by:
Hi I am trying to connect to a password protected access file from VB.NET. I have no problem in connecting to Access, if I remove the password. This is what I am doing: In the server explorer,...
3
by: Laurence | last post by:
Hi there, Does somebody know the efficent way to connect DB2/400? Through iSeries Access ODBC/OLEDB driver or DB2 Connect? Which will more fast and efficent? In addition, does DB2 Connect use...
3
by: Chris | last post by:
Don't know if there is a simple solution for this one or not. When running SQL server on a machine with 2000 loaded and the complete SQL package I don't have any issues. Now I'm trying to login...
3
by: BigZero | last post by:
hello i m new to php i m working on project that has interface with simple html and php i m thinking to use i got some problem with the connecting to DB here is the code for connecting db ...
2
by: franc sutherland | last post by:
Hi, I am trying to build a database in Access 2003 which can connect to information in a SAGE system. Should I use ODBC, and if so, which driver is required? Is there another way of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.