locked
Error Message in VB Express RRS feed

  • Question

  • I have created a Database in SQL Management Studio, i now want to build the front end in VB Express 2010, On trying to add the DB to VB Express, I get Error message

    " You don't have permission to open this file. Contact the Owner or an administrator to obtain permission"

    I tried to copy the DB mdf and log files and move to onother folder, but same error message, as well as " File is opened by another user. Even though my MS SQL Managment Studio is closed

    As I am working of my local laptop, and only user, the settings for the SQL Epress is set to Windows Authentication.

    I looked at the " permission setting", but can not get any wiser, if after ticking all the grant and with grant boxes

    very puzzled?

    Wednesday, September 19, 2012 7:35 PM

Answers

  • Be sure that you are debugging the program as an admin. That is the problem 9/10 times.

    If you found my post helpful, please give me a recognition point on the left hand side of my post.

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:13 AM
    Wednesday, September 19, 2012 10:18 PM
  • Is SQL Server (Express) running and could it possibly be keeping the file in use?
    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:13 AM
    Wednesday, September 19, 2012 10:47 PM
  • hI,

    Try to restart yout PC and make sure close the SQL server and than run the application again.


    No code, No fact.

    • Proposed as answer by Mark Liu-lxf Friday, September 21, 2012 2:53 AM
    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:12 AM
    Thursday, September 20, 2012 7:06 AM
  • My SQl Management Studio is closed.

    I think Chris meant not just SSMS but also the SQL Server service (Control Panel -> Administrative Tools -> Services). Although I suspect you won't be able to use SQL Server then, so perhaps you need to detach the database in SSMS.

    Incidentally, you can connect to the server through the service rather than trying to attach a file. http://www.connectionstrings.com/sql-server-2008.

    --
    Andrew

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:12 AM
    Thursday, September 20, 2012 8:29 AM
  • Thanks for that, it one step closer, now new message,

    "This file is in Use, enter new name or close the file that's open in other program."

    My SQL Manager is closed an and not connected. 


    I have another DB file which I got from outside source, connecting with this is no problem

    Another puzzle!


    george

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:13 AM
    Thursday, September 20, 2012 4:09 AM
  • Thanks for quick answer.

    My SQl Management Studio is closed.

    I am now running as Admin, so the permission part is gone.

    but now get new message " This file is in use. Enter new name and close the file that is open with other program"


    george

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:14 AM
    Thursday, September 20, 2012 4:13 AM
  • Hi Andrew,

    Thanks for the input, It juts required a re-boot after I have change the settings to "Run as Administrator" in both VB Studio and SSMS.

    George


    george

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:12 AM
    Thursday, September 20, 2012 9:11 AM

All replies

  • Be sure that you are debugging the program as an admin. That is the problem 9/10 times.

    If you found my post helpful, please give me a recognition point on the left hand side of my post.

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:13 AM
    Wednesday, September 19, 2012 10:18 PM
  • Is SQL Server (Express) running and could it possibly be keeping the file in use?
    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:13 AM
    Wednesday, September 19, 2012 10:47 PM
  • Thanks for that, it one step closer, now new message,

    "This file is in Use, enter new name or close the file that's open in other program."

    My SQL Manager is closed an and not connected. 


    I have another DB file which I got from outside source, connecting with this is no problem

    Another puzzle!


    george

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:13 AM
    Thursday, September 20, 2012 4:09 AM
  • Thanks for quick answer.

    My SQl Management Studio is closed.

    I am now running as Admin, so the permission part is gone.

    but now get new message " This file is in use. Enter new name and close the file that is open with other program"


    george

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:14 AM
    Thursday, September 20, 2012 4:13 AM
  • hI,

    Try to restart yout PC and make sure close the SQL server and than run the application again.


    No code, No fact.

    • Proposed as answer by Mark Liu-lxf Friday, September 21, 2012 2:53 AM
    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:12 AM
    Thursday, September 20, 2012 7:06 AM
  • Thanks, Sometimes we forget the smallest part as the most essential - Rebooting was the last thing on my mind!

    It works no - feel quite dumb


    george

    Thursday, September 20, 2012 8:22 AM
  • My SQl Management Studio is closed.

    I think Chris meant not just SSMS but also the SQL Server service (Control Panel -> Administrative Tools -> Services). Although I suspect you won't be able to use SQL Server then, so perhaps you need to detach the database in SSMS.

    Incidentally, you can connect to the server through the service rather than trying to attach a file. http://www.connectionstrings.com/sql-server-2008.

    --
    Andrew

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:12 AM
    Thursday, September 20, 2012 8:29 AM
  • Hi Andrew,

    Thanks for the input, It juts required a re-boot after I have change the settings to "Run as Administrator" in both VB Studio and SSMS.

    George


    george

    • Marked as answer by WHAT KIDS WANT Friday, September 21, 2012 4:12 AM
    Thursday, September 20, 2012 9:11 AM