473,770 Members | 6,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access databases can not be used in VS 2005

Hi all,

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 page "How to: Connect to Data in an Access Database
"http://msdn2.microsoft .com/en-us/library/cf131f6b.aspx states the
following on how to connect to a Access database:
1. On the Data menu, click Add New Data Source.
2. Select Database on the Choose a Data Source Type page.
3. Select New Connection to create a new data connection. Note
If the Data source is not Microsoft Access Database File, then select
Change to open the Choose/Change Data Source dialog box, select Microsoft
Access Database File, and then click Continue.
4. The default provider is .NET Framework Provider for OLE DB. For more
information, see Choose/Change Data Source Dialog Box.
5. In the Database file name box, enter the path to the .mdb file, or
click the Browse button to locate the database file.
6. Enter login information if required by your database. For more
information, see Add/Modify Connection (Microsoft Access).
7. Click OK, and then click Next.
In step 5 above it talks of a browse button. I dont't get that but rather am
given a dialog box titled Add Connection and the only option is
ConnectionStrin g. I have tried all sorts of options for a connect string but
allways get the error message "Format of the initialization string does not
conform to
specification starting at index 0"

Problem 2:
=======
From the same page it states: "Drag an .mdf or .mdb file from Windows
Explorer into Solution Explorer to automatically configure your connection
and start the Data Source Configuration Wizard ready for you to select the
objects to use in your application."
When I drag and drop drop an Access database eg. Northwind.mdb into the
Solution Explorer window I get the following error: "An eror occurred while
processing the local data file: Object reference not set to an instance of an
object"

Questions:
=======
1. In problem 1 why don't I get the correct dialog with browse
functionality? I have Microsoft Visual Studio 2005 Professional installed on
my Laptop and my main PC and they both do the same thing. I have all patches
and updates installed.
2. How do I resolve problem 2? I have searched for a solution and and have
found none. I have uninstalled .Net Framework 2 and reinstalled it with no
difference. I think the two problems are related.

Note: I have also had VS.NET 2002 in parallel on the same box, which had
been uninstalled in the meantime. So I reinstalled VS 2005 too, but the
problem remains. However ODBC for Access databases works, but this is not
wanted.

Thanks in advance, Fritz
--
Fritz Theiss
Mar 18 '07 #1
9 1977
On Sun, 18 Mar 2007 10:25:05 -0700, Fritz <Fr***@discussi ons.microsoft.c omwrote:

¤ Problem 1:
¤ =======
¤ The Microsoft page "How to: Connect to Data in an Access Database
¤ "http://msdn2.microsoft .com/en-us/library/cf131f6b.aspx states the
¤ following on how to connect to a Access database:
¤
¤
¤ 1. On the Data menu, click Add New Data Source.
¤ 2. Select Database on the Choose a Data Source Type page.
¤ 3. Select New Connection to create a new data connection. Note
¤ If the Data source is not Microsoft Access Database File, then select
¤ Change to open the Choose/Change Data Source dialog box, select Microsoft
¤ Access Database File, and then click Continue.
¤ 4. The default provider is .NET Framework Provider for OLE DB. For more
¤ information, see Choose/Change Data Source Dialog Box.
¤ 5. In the Database file name box, enter the path to the .mdb file, or
¤ click the Browse button to locate the database file.
¤ 6. Enter login information if required by your database. For more
¤ information, see Add/Modify Connection (Microsoft Access).
¤ 7. Click OK, and then click Next.
¤
¤
¤ In step 5 above it talks of a browse button. I dont't get that but rather am
¤ given a dialog box titled Add Connection and the only option is
¤ ConnectionStrin g. I have tried all sorts of options for a connect string but
¤ allways get the error message "Format of the initialization string does not
¤ conform to
¤ specification starting at index 0"

In step three when you click on New Connection, change the Data Source to Microsoft Access Database
File and then click on the Browse command button to select the file name. That should take you to
step seven.

¤ Problem 2:
¤ =======
¤ From the same page it states: "Drag an .mdf or .mdb file from Windows
¤ Explorer into Solution Explorer to automatically configure your connection
¤ and start the Data Source Configuration Wizard ready for you to select the
¤ objects to use in your application."
¤
¤
¤ When I drag and drop drop an Access database eg. Northwind.mdb into the
¤ Solution Explorer window I get the following error: "An eror occurred while
¤ processing the local data file: Object reference not set to an instance of an
¤ object"

I can't reproduce this issue.

Sounds like you might have a bad install.
Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 19 '07 #2
Thanks so far.

See inline, commented with Fritz.

--
Fritz Theiss
"Paul Clement" wrote:
On Sun, 18 Mar 2007 10:25:05 -0700, Fritz <Fr***@discussi ons.microsoft.c omwrote:

¤ Problem 1:
¤ =======
¤ The Microsoft page "How to: Connect to Data in an Access Database
¤ "http://msdn2.microsoft .com/en-us/library/cf131f6b.aspx states the
¤ following on how to connect to a Access database:
¤
¤
¤ 1. On the Data menu, click Add New Data Source.
¤ 2. Select Database on the Choose a Data Source Type page.
¤ 3. Select New Connection to create a new data connection. Note
¤ If the Data source is not Microsoft Access Database File, then select
¤ Change to open the Choose/Change Data Source dialog box, select Microsoft
¤ Access Database File, and then click Continue.
¤ 4. The default provider is .NET Framework Provider for OLE DB. For more
¤ information, see Choose/Change Data Source Dialog Box.
¤ 5. In the Database file name box, enter the path to the .mdb file, or
¤ click the Browse button to locate the database file.
¤ 6. Enter login information if required by your database. For more
¤ information, see Add/Modify Connection (Microsoft Access).
¤ 7. Click OK, and then click Next.
¤
¤
¤ In step 5 above it talks of a browse button. I dont't get that but rather am
¤ given a dialog box titled Add Connection and the only option is
¤ ConnectionStrin g. I have tried all sorts of options for a connect string but
¤ allways get the error message "Format of the initialization string does not
¤ conform to
¤ specification starting at index 0"

In step three when you click on New Connection, change the Data Source to Microsoft Access Database
File and then click on the Browse command button to select the file name. That should take you to
step seven.
Fritz: No, it does not. There is no browse button available.
>
¤ Problem 2:
¤ =======
¤ From the same page it states: "Drag an .mdf or .mdb file from Windows
¤ Explorer into Solution Explorer to automatically configure your connection
¤ and start the Data Source Configuration Wizard ready for you to select the
¤ objects to use in your application."
¤
¤
¤ When I drag and drop drop an Access database eg. Northwind.mdb into the
¤ Solution Explorer window I get the following error: "An eror occurred while
¤ processing the local data file: Object reference not set to an instance of an
¤ object"

I can't reproduce this issue.
Fritz: I believe so as I can´t reproduce either on a different machine,
having VS.NET 2002 not installed previously.
>
Sounds like you might have a bad install.
Fritz: I know. The question is: How to get rid of this? As written:
Reinstallation of VS 2005 did not help. From a different thread I saw that
this guy completely(!) reinstalled his machine in order to have this problem
fixed. This option is not available to me.
>

Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 19 '07 #3
Any (further) ideas are appreciated.

Thanks, Fritz
--
Fritz Theiss
"Fritz Theiss" wrote:
Thanks so far.

See inline, commented with Fritz.

--
Fritz Theiss
"Paul Clement" wrote:
On Sun, 18 Mar 2007 10:25:05 -0700, Fritz <Fr***@discussi ons.microsoft.c omwrote:

¤ Problem 1:
¤ =======
¤ The Microsoft page "How to: Connect to Data in an Access Database
¤ "http://msdn2.microsoft .com/en-us/library/cf131f6b.aspx states the
¤ following on how to connect to a Access database:
¤
¤
¤ 1. On the Data menu, click Add New Data Source.
¤ 2. Select Database on the Choose a Data Source Type page.
¤ 3. Select New Connection to create a new data connection. Note
¤ If the Data source is not Microsoft Access Database File, then select
¤ Change to open the Choose/Change Data Source dialog box, select Microsoft
¤ Access Database File, and then click Continue.
¤ 4. The default provider is .NET Framework Provider for OLE DB. For more
¤ information, see Choose/Change Data Source Dialog Box.
¤ 5. In the Database file name box, enter the path to the .mdb file, or
¤ click the Browse button to locate the database file.
¤ 6. Enter login information if required by your database. For more
¤ information, see Add/Modify Connection (Microsoft Access).
¤ 7. Click OK, and then click Next.
¤
¤
¤ In step 5 above it talks of a browse button. I dont't get that but rather am
¤ given a dialog box titled Add Connection and the only option is
¤ ConnectionStrin g. I have tried all sorts of options for a connect string but
¤ allways get the error message "Format of the initialization string does not
¤ conform to
¤ specification starting at index 0"

In step three when you click on New Connection, change the Data Source to Microsoft Access Database
File and then click on the Browse command button to select the file name. That should take you to
step seven.

Fritz: No, it does not. There is no browse button available.

¤ Problem 2:
¤ =======
¤ From the same page it states: "Drag an .mdf or .mdb file from Windows
¤ Explorer into Solution Explorer to automatically configure your connection
¤ and start the Data Source Configuration Wizard ready for you to select the
¤ objects to use in your application."
¤
¤
¤ When I drag and drop drop an Access database eg. Northwind.mdb into the
¤ Solution Explorer window I get the following error: "An eror occurred while
¤ processing the local data file: Object reference not set to an instance of an
¤ object"

I can't reproduce this issue.

Fritz: I believe so as I can´t reproduce either on a different machine,
having VS.NET 2002 not installed previously.

Sounds like you might have a bad install.

Fritz: I know. The question is: How to get rid of this? As written:
Reinstallation of VS 2005 did not help. From a different thread I saw that
this guy completely(!) reinstalled his machine in order to have this problem
fixed. This option is not available to me.


Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 20 '07 #4
On Tue, 20 Mar 2007 01:28:08 -0700, Fritz Theiss <Fr*********@di scussions.micro soft.comwrote:

¤ Any (further) ideas are appreciated.

I would uninstall any versions of Visual Studio.NET you have installed. Also, uninstall all versions
of the .NET Framework and make sure to delete any files or folders that are left over before
reinstalling.
Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 20 '07 #5
As written previously - I have uninstalled both versions of VS and only
re-installed VS 2005. Ok, I did not uninstall .NET Framework. But this I
declined on purpose.

Due to another issue in the past, I have contacted MS Support: Their
recommendation in case of un-installing .NET Framework is: Re-install the
complete box due to appearing inconsistencies . And this is - as said - not on
my radar...

--
Fritz Theiss
"Paul Clement" wrote:
On Tue, 20 Mar 2007 01:28:08 -0700, Fritz Theiss <Fr*********@di scussions.micro soft.comwrote:

¤ Any (further) ideas are appreciated.

I would uninstall any versions of Visual Studio.NET you have installed. Also, uninstall all versions
of the .NET Framework and make sure to delete any files or folders that are left over before
reinstalling.
Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 20 '07 #6
I've also just recenlty run into this problem and would like to know how
to fix it.

I've installed it on a laptop & workstation with the only signinficant
difference between the two being that the laptop has Office 2007 on it
(and this is the machine it does NOT work on) and the workstation has
Office XP (and this is the machine it DOES work on).

This problem has signinficant decreased my productivity since I now have
to manually create all the connection objects, data adpater objects, and
(worst of all) configuring the Grid View control controls for the
resulting dataset.

I am also in a position where a complete uninstall of Windows XP is not
an option.

Thank you,

Drew
Jun 10 '07 #7
On 09 Jun 2007, you wrote in microsoft.publi c.vsnet.general :
I've also just recenlty run into this problem and would like to know
how
to fix it.

I've installed it on a laptop & workstation with the only signinficant
difference between the two being that the laptop has Office 2007 on it
(and this is the machine it does NOT work on) and the workstation has
Office XP (and this is the machine it DOES work on).

This problem has signinficant decreased my productivity since I now
have
to manually create all the connection objects, data adpater objects,
and
(worst of all) configuring the Grid View control controls for the
resulting dataset.

I am also in a position where a complete uninstall of Windows XP is
not
an option.

Thank you,

Drew
I think I might have a solution.
I noticed my Server Explorer had a Data Connection to a local instance
of
a SQL server that I no longer have on my laptop, so I removed it.

On a lark, the next time I opened VS 2005 I thought I'd give the Access
Data Connection another try and this time it worked!

I'm guessing if you still have a problem, check your other Data
Connections listed in the Server Explorer and remove any that you aren't
using. Worth a shot!

--
Drew
Jun 10 '07 #8
Ok, I am having the same problem. I have deleted all my connections and
tried it again, and it did not fix it. I have VS2003 and VS2005 on my
machine and have uninstalled and reinstalled VS2005 to no avail.
In my case, this was working at one time and has stopped! The only
significant change I have made to this machine was to upgrade IE from version
6 to 7.

Anyone have anymore ideas?

--
Terry
"Fritz" wrote:
Hi all,

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 page "How to: Connect to Data in an Access Database
"http://msdn2.microsoft .com/en-us/library/cf131f6b.aspx states the
following on how to connect to a Access database:
1. On the Data menu, click Add New Data Source.
2. Select Database on the Choose a Data Source Type page.
3. Select New Connection to create a new data connection. Note
If the Data source is not Microsoft Access Database File, then select
Change to open the Choose/Change Data Source dialog box, select Microsoft
Access Database File, and then click Continue.
4. The default provider is .NET Framework Provider for OLE DB. For more
information, see Choose/Change Data Source Dialog Box.
5. In the Database file name box, enter the path to the .mdb file, or
click the Browse button to locate the database file.
6. Enter login information if required by your database. For more
information, see Add/Modify Connection (Microsoft Access).
7. Click OK, and then click Next.
In step 5 above it talks of a browse button. I dont't get that but rather am
given a dialog box titled Add Connection and the only option is
ConnectionStrin g. I have tried all sorts of options for a connect string but
allways get the error message "Format of the initialization string does not
conform to
specification starting at index 0"

Problem 2:
=======
From the same page it states: "Drag an .mdf or .mdb file from Windows
Explorer into Solution Explorer to automatically configure your connection
and start the Data Source Configuration Wizard ready for you to select the
objects to use in your application."
When I drag and drop drop an Access database eg. Northwind.mdb into the
Solution Explorer window I get the following error: "An eror occurred while
processing the local data file: Object reference not set to an instance of an
object"

Questions:
=======
1. In problem 1 why don't I get the correct dialog with browse
functionality? I have Microsoft Visual Studio 2005 Professional installed on
my Laptop and my main PC and they both do the same thing. I have all patches
and updates installed.
2. How do I resolve problem 2? I have searched for a solution and and have
found none. I have uninstalled .Net Framework 2 and reinstalled it with no
difference. I think the two problems are related.

Note: I have also had VS.NET 2002 in parallel on the same box, which had
been uninstalled in the meantime. So I reinstalled VS 2005 too, but the
problem remains. However ODBC for Access databases works, but this is not
wanted.

Thanks in advance, Fritz
--
Fritz Theiss
Jun 18 '07 #9
Try this
assume xxx.mdb contains a table called 'table name' which contains ID,
lname, fname.
string constring= "provider= Microsoft.Jet.O LEDB; Data source= c:\xxx.mdb";
OlebConnection connection= new Oledbconnection (constring);
connection.Open ();
OleDataadapter da= new Oledataadapter ("Select * from table name",connectio n);
Dataset ds= new Dataset();
da.fill(ds,"tab le name");
connection.Clos e();
foreach(DataRow d in ds.Tables[table name].Rows)
{
MessageBox.Show ("Ifound "+ d["lname"].ToString()+" "+d["fname"].ToString());
}
You may also use a dataview to find data

Dataview DV= new DataView(ds.Tab les[table name"],"","fname",Dat aviewoptions.
none);

int f= DV.Find("frank" );

if (f -1)
{
MessageBox. Show( "I found Frank at row"+ f);
or MessageBox.Show (DV[f]["fname"].ToString() +" "+
DV[f]["Lname"].ToString()+ " was found at row "+f );

}


"Drew" wrote:
I've also just recenlty run into this problem and would like to know how
to fix it.

I've installed it on a laptop & workstation with the only signinficant
difference between the two being that the laptop has Office 2007 on it
(and this is the machine it does NOT work on) and the workstation has
Office XP (and this is the machine it DOES work on).

This problem has signinficant decreased my productivity since I now have
to manually create all the connection objects, data adpater objects, and
(worst of all) configuring the Grid View control controls for the
resulting dataset.

I am also in a position where a complete uninstall of Windows XP is not
an option.

Thank you,

Drew
Sep 11 '07 #10

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

Similar topics

33
5952
by: Uwe Range | last post by:
Hi to all! A customer of mine told me some days ago that her IT-people told her ACCESS would not be such a good idea for continuing with our project, because Access will not be continued in the future. I haven't heard of this. Does anybody know more about it? The IT-People usually prefer Oracle. If they really want to go in this direction, could our Access-application (if continued) be used as a front end with an Oracle back end? Does...
9
4468
by: MM | last post by:
And Access 2000 et seq 32 bit? MM
1
3347
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ... www.soft30.com/download-1-11975.htm - 31k - Cached - Similar pages MDBSecure 1.0.8.0 - Soft30.com Utility which makes it easy to create secure MS Access Databases, ... MS Access 2000/2003 format. 30 day money back guarantee, 30 day trial. ...
17
2496
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a thousand items and the accounting side will be used for hopefully many years so the entries are likely to be vast. The delema is what is best to use ase the DB engine, Access I have as part of Office 2002 or should I really be looking at SQL...
2
3176
by: Anns via SQLMonster.com | last post by:
I have about 20 Ms Access Databases to need to be upload onto a SQL Server 2005. Currently the are on a network/server residing on a specific drive. The goal is to keep the user face the same (ms access) and put all of the tables onto a SQL Server 2005 BE, and yet make those databases accessible to open/view through Ms Sharepoint. What is the simple (properties) way to grab all of those db's = 20 and upload to server?
3
3293
by: Anns via AccessMonster.com | last post by:
Pros and Cons to the below: Upsizing Wizard - will this carry over tbls, queries, etc together? DTS or IS SQL 2005 - does this only bring over the tables? Which should I use? After the wizard is used to connect to SQL, do I still have to link the tables? If so, please explain.
18
9151
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 page "How to: Connect to Data in an Access Database"
26
2393
by: codercode | last post by:
I'm working on a Visual Basic .NET using Access database. However, my client already have a 30MB database with Sybase ASA and Sybase is way too much for that. Is there anyway I can migrate from a Sybase to Access? or is it possible at all. If it is not, can these two databases co-exist together?
2
3164
by: JA | last post by:
Is it possible to connect to Sql Server 2005 using an Access 2000 adp? I keep trying, but it doesn't want to accept my id, even though it is right.
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10053
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10001
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9867
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8880
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.