如何从VB.Net应用程序打开访问数据库(.mdb)? [英] How can I open a access database (.mdb) from VB.Net application?
本文介绍了如何从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[^]
这篇关于如何从VB.Net应用程序打开访问数据库(.mdb)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文