从vb.net应用程序创建访问数据库,其中未安装MS-Office [英] Create access database from vb.net application, where MS-Office is not installed

查看:100
本文介绍了从vb.net应用程序创建访问数据库,其中未安装MS-Office的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从VB.NET应用程序创建访问数据库。

在我的机器上安装了MS-Office,我在我的应用程序中使用以下代码来创建Access数据库..

I want to create access database from VB.NET application.
On my machine, MS-Office is installed, and I am using the following code in my application to create Access database..

Dim cat As New ADOX.Catalog
Dim sCreateString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" <database name> & ".mdb"
cat.Create(sCreateString)



在我的机器上,此代码有效,但我在运行Windows 7的64位机器上尝试了我的应用程序,并且未安装MS-Access。我在以下声明中收到错误。


On my machine, this code works, but I tried my application on 64-bit machine running windows 7, and MS-Access not installed. I am getting error on following statement.

cat.Create(sCreateString)





请为此建议,我该怎么办?



Kindly suggest for that, what can I do?

推荐答案

您需要在另一台机器上存在Access DB。上面代码中的cat.Create()没有创建Access DB,而是创建了与已存在的数据库的连接。
You need to have your Access DB present on the other machine. cat.Create() in your code above isn't creating an Access DB, it's creating a connection to a DB that already exists.


您的应用程序是否在客户端计算机上运行。 br />
如果不是你可以右键点击你的项目解决方案goto属性在属性中将平台更改为x86并创建应用程序的新exe并检查。
your application is running on client machine or not.
if not the you can right click on your project solution goto properties in properties change platform to x86 and crate new exe of your application and check .


这篇关于从vb.net应用程序创建访问数据库,其中未安装MS-Office的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆