Mehrdad
Mehrdad

Reputation: 149

aspnetdb.mdf and Microsoft.ACE.OLEDB.12.0

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

Upvotes: 0

Views: 1316

Answers (1)

ZippyV
ZippyV

Reputation: 13038

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.

Upvotes: 1

Related Questions