aspnetdb.mdf 和 Microsoft.ACE.OLEDB.12.0

发布于 2024-09-14 14:00:52 字数 381 浏览 4 评论 0原文

我正在尝试在 Windows 计算机(XP SP3、Vista、7)上运行我的 asp.net 应用程序,该计算机仅安装 Microsoft.ACE.OLEDB.12.0 作为数据库引擎,并且需要连接到标准 aspnetdb.mdf 用户数据库。

有谁知道在这种情况下可以使用适用于 mdf 文件的连接字符串吗?我使用了这样的连接字符串,但尚未成功:

connectionString = "provider=Microsoft.ACE.OLEDB.12.0;Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" ;

谢谢

I'm trying to run my asp.net application on a windows machine (XP SP3, Vista, 7) which has only Microsoft.ACE.OLEDB.12.0 as the database engine installed and need to connect to the standard aspnetdb.mdf user database.

Does any one know it is possible to use a connection string that works with mdf files in such a condition? I used connection strings like this but no success yet:

connectionString = "provider=Microsoft.ACE.OLEDB.12.0;Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true";

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风也等你 2024-09-21 14:00:52

尝试这样的操作:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\aspnetdb.accdb;Persist Security Info=False;

有关更多连接字符串,请转至 http://www.connectionstrings.com/access-2007

编辑:无法使用 OleDB 连接到 Sql Server 数据库。请安装 SQL Server (Express)。

Try one like this:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\aspnetdb.accdb;Persist Security Info=False;

For more connectionstrings, go to http://www.connectionstrings.com/access-2007

EDIT: It's not possible to connect to a Sql Server database using OleDB. Install SQL Server (Express) instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文