Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all

Iam new to sql server and I was just trying to convert an application done with acess database to SQL server database
Since SQL server 2008 is already present in the visual studio I had created a service based database but when i try to connect this using oledbdataconnection Iam getiing a error message as below(at test connection)



Test connection failed because of an error in intializing provider.
Unable to open the physicalfile "D:\WindowsFormsApplication3\WindowsFormsApplication3\masterdatabase.mdf"
Operation system error 5 : 5"(Access is denied)",

I don't know whether its problem with my security setting or some thing else but i had tried many tips on firewall to solve this

mine is msqlserver located localy and its running .

can anyone pls suggest me some idea to solve this
Posted
Updated 19-Sep-19 21:22pm
Comments
ZurdoDev 9-Feb-12 17:00pm    
Can you use a SQLConnection instead of an OLEDBConnection?
SREENATH GANGA 10-Feb-12 5:18am    
I tried it but same result

ZurdoDev 10-Feb-12 8:02am    
What does same result mean? If you got the same error then you used the SQLConnection incorrectly.

It sounds like that the database file you're trying to use, has security issues to access.

As an alternative, try to create a sample Windows Application and drag and drop an OleDbConnection onto the WinForm,according to the wizard,you should get a correct conn str,copy and paste it into your app.config or web.config。
 
Share this answer
 
I found out to be a simple security issue, just closed the application VS2008 and opened it again by right clicking and opening it as "Run As Administrator" and all was set.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900