如何将MS ACCESS数据库连接到vb.net

如何将MS ACCESS数据库连接到vb.net

问题描述:

目前我正在使用ODBC连接字符串将数据库连接到vb.net应用程序。但是在连接字符串中,我必须硬编码数据库路径。当我必须在客户端PC中安装它时,我必须将数据库放在同一个数据库中location.Is有什么方法可以将db放在任何地方,vb.net应用程序自己考虑db?或者是否可以直接建立odbc连接(控制面板 - >管理工具 - >数据源(ODBC))通过代码?

请帮帮我。

提前致谢。

Presently I am using ODBC connection string to connect database to vb.net application.But in connection string,I have to hard code database path.When I have to install it in clients PC,I have to place db in that same location.Is there any way that I can place db anywhere and vb.net application considers that db on its own?Or is it possible to make odbc connection(Control Panel->Administrative Tools->data Source(ODBC))directly through code?
Please help me with this.
Thanks in advance.