database 如何连接到 Visual Studio 2008 中的 Access 2007 (accdb) 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/799129/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 07:16:08  来源:igfitidea点击:

How do I connect to an Access 2007 (accdb) file in Visual Studio 2008

databasevb.netvisual-studio-2008ms-access

提问by Khalid Abuhakmeh

I'm in a college class using the Microsoft visual studio 2008 for visual basic and i have a project where i'm supposed to connect a database but it can't recognize the database file as a database. I followed the book exactly so i don't know what the problem is.

我在大学课堂上使用 Microsoft Visual Studio 2008 for Visual Basic,我有一个项目,我应该在其中连接数据库,但它无法将数据库文件识别为数据库。我完全遵循了这本书,所以我不知道问题是什么。

回答by Jon B

You may need to install the Office 2007 Data Connectivity Components.

您可能需要安装Office 2007 数据连接组件

(See also: this MSDN forum post)

(另请参阅:此 MSDN 论坛帖子

回答by Khalid Abuhakmeh

Check out http://connectionstrings.com/access-2007

查看http://connectionstrings.com/access-2007

this site will tell you what connection string you need to connect to Access 2007. Make sure your connection string is OK. Also try using the server explorer in Visual Studio to connect to the file; just add a new connection pointing to the Access file and click the "Test Connection" button and you should be good to go. Hope that helps.

此站点将告诉您连接到 Access 2007 所需的连接字符串。确保您的连接字符串正确。还可以尝试使用 Visual Studio 中的服务器资源管理器连接到文件;只需添加一个指向 Access 文件的新连接,然后单击“测试连接”按钮,您就可以开始使用了。希望有帮助。

回答by Terry

Maybe you are a visual person: MSDN How Do I Video SeriesThis helped me out when building in an Access database to a project. TableAdapters is what I did not know how to implement and after this tutorial, I was doing great.

也许你是一个有视觉的人:MSDN How Do I Video Series这在将 Access 数据库构建到项目时帮助了我。TableAdapters 是我不知道如何实现的,在本教程之后,我做得很好。

回答by Mamoon Ahmed

It will not connect until you change the format to mdb . go to acces project and go in save as option and save as access 2000 compatible format . now connect it to vb it will be connected . accdb file formats are supported by vb 2010 or 2010 too i think . Regards

在您将格式更改为 mdb 之前,它不会连接。转到 acces 项目并进入另存为选项并另存为 access 2000 兼容格式。现在将它连接到 vb 它将被连接。我认为 vb 2010 或 2010 也支持 accdb 文件格式。问候