如何从VB.Net应用程序打开访问数据库(.mdb)?

问题描述:

从vb.net应用程序连接访问数据库时遇到一些问题.我正在Windows 7操作系统的64位计算机上工作.我需要一个示例代码来访问数据库.

I am face some problem to connect access database from my vb.net application. I am working in 64 bit machine with Windows 7 operating systems. I need a sample code to access the database.



在这里看看:
http://support.microsoft.com/kb/821765 [
Hi,

Have a look here:
http://support.microsoft.com/kb/821765[^]


下面是代码段:

Here is the code snippet:

Dim cn As New OleDbConnection
 cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|Data.mdb;Persist Security Info=True"
 cn.Open()
 cn.Close()



另外,您可以学习本教程:
http://www.geekpedia.com/tutorial158_Connect-to-Access -Database-in-Visual-Studio-.NET.html

有关更多帮助,请参考 Google [ ^ ]



Also, you can study this tutorial:
http://www.geekpedia.com/tutorial158_Connect-to-Access-Database-in-Visual-Studio-.NET.html

and for more help refer Google[^]