469,610 Members | 1,494 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

repost of an old question on a problem with Access connection...

When I asked this question before, don't think I was showing up as an MSDN
subscriber, so I hope that is fixed now.

I am a newbe here and am working through some books on using ADO.Net.
These database books were writen for VS2003. I have both VS2003 andVS2005.
In VS2003 all works fine. Right click 'Data Connections', select add new
connection, switch to 'Provider' tab and select
Provider=Microsoft.Jet.OLEDB.4.0, click Next, and browse to the Access mdf
file and all is ok.
In VS2005 this does not work! I right click 'Data Connections', select
add new connection. The Add Connections dialog appears, the Data Source is
preset to '.NET Framwork Data Provider for OLE DB'. I drop down the 'OLE DB
Provider' and select 'Microsoft Jet 4.0 OLE DB Provider'. Click 'Data
Links...', browse to the Access mdf file and hit ok. I test the connection
and it is OK. I hit the Ok button to finish the process and get the
following error message: Object reference not set to an instance of an
object.

Any/all help is greatly appreciated in advance.

--
Terry
Aug 13 '07 #1
6 1135
Hi Terry,

Based on my understanding, you can add a connection to a Access database
file in VS.NET2003, but couldn't do this in VS2005. If I'm off base, please
feel free to let me know.

I performed a test in VS2005, but didn't reproduece the problem on my side.
The following is the steps of my test.

1. Create an Access database file called Database1.mdb and save it to the
root path of D:\.

2. Open VS2005. In the Server Explorer, right click the 'Data Connections'
node and choose 'Add Connection'.

3. In the 'Add Connection' dialog, if the text in the 'Data source' textbox
isn't 'Microsoft Access Database File(OLE DB)', click the 'Change' button
and 'Change Data Source' dialog appears. In this dialog, select 'Microsoft
Access Database File' in the 'Data source' list(at this time, the below
'Data Provider' combobox only contains '.NET Framework Data Provider for
OLE DB'), and press OK and return to the 'Add Connection' dialog.

4. In the 'Add Connection' dialog, click the 'Browse' button to browse to
the Database1.mdb file and press OK.

5. A new node 'Access.D:\Database1.mdb' appears under the 'Data Connection'
node in the Server Explorer.

The version of VS2005 on my machine is Visual Studio 2005 Team Suite
Version 8.0.50727.42(RTM.050727-4200). What's the version of VS2005 on your
machine?

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 14 '07 #2
Hi Linda,
This is a strange problem. I originally posted this in June, but there
was a problem with my no-spam alias and the one registered with my MSDN
subscription, so I got no answeres back then. Also, at that time, I found 2
other threads discussing the same problem. In one of those threads, the
problem suddenly went away - very strange. In my case, I uninstalled VS2005
and reinstalled it and the problem was still there. I tried at least 40-50
times to create a data source from an access database and could not do it
using the OLEDB Jet 4 provider. I got around the problem by setting up an
ODBC connection.
Yesterday, I saw someone having a problem with "Object reference not set
to an instance of an object." and was reminded that I had never got an answer
to the original question, so I reposted it now that my no-spam alias problem
was fixed.
After reposting it, I went in and tried it again and guess what - the
problem had gone away! So just like the other thread, somehow it had fixed
itself. Very strange.
So on my machine, it had originally worked, stopped working for at least
2 weeks and sometime after that started working again and I have no idea how
or why. I do know that I am not the only one who has expierenced this same
behavior. You might want to look for these other threads in the archives,
they were the exact same problem I had.
--
Terry
"Linda Liu [MSFT]" wrote:
Hi Terry,

Based on my understanding, you can add a connection to a Access database
file in VS.NET2003, but couldn't do this in VS2005. If I'm off base, please
feel free to let me know.

I performed a test in VS2005, but didn't reproduece the problem on my side.
The following is the steps of my test.

1. Create an Access database file called Database1.mdb and save it to the
root path of D:\.

2. Open VS2005. In the Server Explorer, right click the 'Data Connections'
node and choose 'Add Connection'.

3. In the 'Add Connection' dialog, if the text in the 'Data source' textbox
isn't 'Microsoft Access Database File(OLE DB)', click the 'Change' button
and 'Change Data Source' dialog appears. In this dialog, select 'Microsoft
Access Database File' in the 'Data source' list(at this time, the below
'Data Provider' combobox only contains '.NET Framework Data Provider for
OLE DB'), and press OK and return to the 'Add Connection' dialog.

4. In the 'Add Connection' dialog, click the 'Browse' button to browse to
the Database1.mdb file and press OK.

5. A new node 'Access.D:\Database1.mdb' appears under the 'Data Connection'
node in the Server Explorer.

The version of VS2005 on my machine is Visual Studio 2005 Team Suite
Version 8.0.50727.42(RTM.050727-4200). What's the version of VS2005 on your
machine?

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 14 '07 #3
Hi Terry,

Thank you for your prompt response.

Microsoft Jet Database Engine is shipped with Windows Operation System. In
the %windir%/System32 folder, there's a dll file named 'msjet40.dll'. From
the property of the file, you could see the versions of the file.

The following KB article discusses how to obtain the latest service pack
for the Microsoft Jet 4.0 Database Engine and how to determine the current
release level of Jet 4.0:

http://support.microsoft.com/kb/239114/

If your problem happens again in the future, you may have a try installing
the lastest service pack for the Microsoft Jet 4.0 Database Engine.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

Aug 17 '07 #4
Hi Terry,

Sorry for my delayed reply!

I know you made great effort trying to solve this problem and I appreciate
your detailed feedback on our product.

We will log this issue in our internal database for better product in the
future.

If the problem happens again in the future, please feel free to post a new
thread and we're here to support you at your convenience.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Aug 17 '07 #5
Hi Terry,

Thank you for your prompt response.

Microsoft Jet Database Engine is shipped with Windows Operation System. In
the %windir%/System32 folder, there's a dll file named 'msjet40.dll'. From
the property of the file, you could see the versions of the file.

The following KB article discusses how to obtain the latest service pack
for the Microsoft Jet 4.0 Database Engine and how to determine the current
release level of Jet 4.0:

http://support.microsoft.com/kb/239114/

If your problem happens again in the future, you may have a try installing
the lastest service pack for the Microsoft Jet 4.0 Database Engine.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

Aug 17 '07 #6
Thank you Linda for your help with this. Hopefully it will not happen again,
but maybe this will help the next person who happens to run accross it.
--
Terry
"Linda Liu [MSFT]" wrote:
Hi Terry,

Thank you for your prompt response.

Microsoft Jet Database Engine is shipped with Windows Operation System. In
the %windir%/System32 folder, there's a dll file named 'msjet40.dll'. From
the property of the file, you could see the versions of the file.

The following KB article discusses how to obtain the latest service pack
for the Microsoft Jet 4.0 Database Engine and how to determine the current
release level of Jet 4.0:

http://support.microsoft.com/kb/239114/

If your problem happens again in the future, you may have a try installing
the lastest service pack for the Microsoft Jet 4.0 Database Engine.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

Aug 20 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.