简体   繁体   English

Windows表格使用访问数据库

[英]Windows form using access database

I am using MS ACCESS database for my windows application. 我正在Windows应用程序中使用MS ACCESS数据库。 In development PC I have install Microsoft Access Database Engine. 在开发PC中,我已经安装了Microsoft Access数据库引擎。 Do I need to install this on the PCs where I will be installing this windows form application. 我是否需要在将要安装此Windows窗体应用程序的PC上安装它。 If not what is the solution to this so that my application can interact with the database like is there any dlls or anything such that need to be included in the application's reference. 如果不是,那么解决方案是什么,以便我的应用程序可以与数据库交互,例如是否有任何dll或其他需要包含在应用程序引用中的内容。 My database is in .accdb format not .mdb 我的数据库是.accdb格式而不是.mdb格式

For your program to interact with the Microsoft Access DB, you would have to create the DB in .accdb first. 为了使程序与Microsoft Access DB进行交互,必须首先在.accdb中创建数据库。 Once that is done, goto 完成后,转到

Control Panel->Administrative Tools->Data Sources(ODBC)->System DSN. 控制面板->管理工具->数据源(ODBC)->系统DSN。

Here select Microsoft Access Driver(*.accdb, *.mdb).A pop up window opens. 在这里选择Microsoft Access Driver(*。accdb,* .mdb)。会弹出一个窗口。 There first give a name to your file. 首先给您的文件起一个名字。

Remember to use this name in your code to access your MS Accesss DB 切记在代码中使用此名称访问MS Accesss数据库

Then click Add to navigate and add your .accdb file and click OK. 然后单击“添加”以导航并添加您的.accdb文件,然后单击“确定”。 Now your DB is live for you in local system for you to use. 现在,您的数据库已经在本地系统中供您使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM