0
votes

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

1
i don't see anything wrong with that connection string. perhaps if you posted the error you are getting you'll get an answer.Al W

1 Answers

1
votes

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.