开发者

aspnetdb.mdf and Microsoft.ACE.OLEDB.12.0

开发者 https://www.devze.com 2023-01-12 03:38 出处:网络
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.

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;Integr开发者_StackOverflow社区ated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true";

Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消