Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I create an access database file by using Microsoft Access 2007. I use Visual Studio 2010 to write a program which need a database. I want to use the file as the database. I think this is the simplest way to write a rapid program to hold some data and manage them. Am I right?
Then, in the Server Explorer window, I choose Add Connection... from Data Connections context menu. Then I choose Microsoft Access Database File from the brought up window and click Continue. I browse for the file and click on OK button. It errors:

No error message available, result code: E_UNEXPECTED(0x8000FFFF)

If I click on the Test Connection button, I get the same result. What's wrong? Maybe I've to create some users for my database?

What I have tried:

First, I'm not sure it's a user definition issue. Then, I don't know how to create a user for my database. I investigated in the Access menus for this and found nothing.
Posted
Updated 3-Jan-17 23:25pm

I wouldn't think happened because a user isn't defined. As far as I know 0x8000FFFF is a catastrophic failure so for some reason the connection cannot be established.

I would check if the OleDb provider is correctly installed and can you connect to the database from the code using OleDbConnection Class (System.Data.OleDb)[^]
 
Share this answer
 
Comments
ilostmyid2 4-Jan-17 6:05am    
still not in programming to use a class.
Wendelius 4-Jan-17 9:51am    
I understand that you're trying to use Visual Studio to connect but to get more details about the problem I suggest writing a short, simple code and try to connect to the Access database via code. This tells us if the connection can succeed or not and if the problem is in Visual Studio or for example in OleDb setup.
I provided a class in my solution to this answer:

How do I run access from a WS 2012 and IIS 8 with ASP.NET[^]
 
Share this answer
 
v2
Comments
ilostmyid2 4-Jan-17 6:26am    
it's for when one want to access the db from withing the program. my problem is before beginning programming.
#realJSOP 4-Jan-17 7:14am    
I changed my answer. Go to the link and scroll down to my answer to that question. There's a class there that should help. Assuming you have the correct connection string, you should be good to go with that code.
ilostmyid2 5-Jan-17 3:42am    
oh my!
i changed the Windows to 7 with the same work of success! something seems to be wrong in XP
ilostmyid2 4-Jan-17 8:09am    
As I told before, it's before coding. Unless I may connect to the database directly by mentioning the Access file name from inside the program.
There are quite a few reasons why that may be a problem.
Start with the obvious: is the file available to all users? It's quite possible that the Connection Wizard isn't using your user ID to access the file, so if the file or teh folder it's sitting in doesn't have the required access permissions for all users, then it could easily fail.
After that, check the type of DB engine you have installed to connect to Access files: ACE or JET. JET is the older version, and isn't available in a 64 bit version - so again you could get a failure connecting there if the code trying to connect is 64 bit or "any CPU". But...Visual Studio itself is a 32 bit app, so it can't use 64 bit drivers directly - so if the connection tester is actually part of VS it could be failing because the DB engine is 64 bits and it can't run that!

Basically, we can't tell you "do this, and it'll be good" - but if you get more grief when you've looked that those things, try modifying an existing DB connection string and using it in an OleDbConnection object in your code: Access connection strings - ConnectionStrings.com[^] may well help.
 
Share this answer
 
Comments
ilostmyid2 4-Jan-17 6:04am    
Note that I'm still not going to access the database from inside the program. No program is still written.
About 64-bit issues, it's not applicable. I'm using Windows XP and it's 32-bit in architecture. So, the access issue is also not applicable.
About the DB Engine. I thought no other thing is required when I'm using an Access file as my database. When VS has such a dialog to connect to an Access file as a database, it should recognize the database directly without using any engine. I thought all connections to such file should be implemented internally. If I'm in mistake, please let me know what exactly I've to do. What's ACE? Should I install something other than Access and VS?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900