473,507 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access connection

90 New Member
I am not able to find "Data Source" when i give the connection for a MS Access plz tell me where I went wrong in thee below shown code snippet

OleDbConnection connection = new OleDbConnection();
connection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0" ,Data Source ="C:\\Documents and Settings\\Administrator\\My Documents\\Database1.accdb;");

As I have used MS Access 2007 the extension is .accdb then here what has to be done?
May 23 '08 #1
1 1347
Curtis Rutland
3,256 Recognized Expert Specialist
I am not able to find "Data Source" when i give the connection for a MS Access plz tell me where I went wrong in thee below shown code snippet

OleDbConnection connection = new OleDbConnection();
connection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0" ,Data Source ="C:\\Documents and Settings\\Administrator\\My Documents\\Database1.accdb;");

As I have used MS Access 2007 the extension is .accdb then here what has to be done?
You can't use Jet for Access 2007, AFAIK. You need to use ACE. Unless you want to save your DB in 2003 format (mdb).

Look here for the correct connection strings. ConnectionStrings.Com has always been a great resource for me.

Edit:
Also, if this is an ASP.NET web app, you might want to look into using the DataDirectory functionality. If you put your DB in the App_Data directory, you don't need the full physical path, just one relative to the application. It's at the bottom of the first link I gave you.
May 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2825
by: Peter Larsson | last post by:
Hello everybody, I'm developing a system for a company that has production at two different locations. The production is stored in an Access database at each location, and I need to find a way...
1
5330
by: James | last post by:
Hi, I am trying to access the MS Access database on my local machine in C# Windows Application in Visual Studio.NET. But it seems that it does not work. I use the Microsoft Application Blocks to...
8
1640
by: Evan | last post by:
If there are any enlightend souls out there that can help me, I would greatly appreciate it. I would like to use a macro to take a value and add it to an access database. I am having a problem...
16
4854
by: Rob Geraghty | last post by:
I've just spent some time looking through FAQ sites and searching the google archives of this newsgroup, but I still haven't been able to find a clear explanation of an issue with multi-user...
13
7253
by: Zlatko Matić | last post by:
Is it possible to use Access as front-end for POstgreSQL and how ? What about Access Projects (.adp) and PostgreSQL ?
6
1677
by: jonefer | last post by:
I have two versions of a 'Downtime Application that will run in the event that the mainframe goes down 1) SQL Server ASP.NET app (accessed outside the mainframe network) 2) MS Access Version of...
8
9609
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
18
9106
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
0
7156
by: JP | last post by:
Hello: I am using VB 6.0 with a Windows XP Professional environment. I am also using Access 2000. I am currently building a program and need reporting capabilities. So, I started a Data...
8
13213
by: mark_aok | last post by:
Hi all, I have a split database. Both the forms, and the tables are stored on a shared network drive (this is Access 2003). The users use the forms, and the tables on the network drive, there...
0
7110
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
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
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
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.