locked
Visual Basic 2010 Express won't work with SQL Server 2008 R2 Express RRS feed

  • Question

  • About 5 days ago I downloaded SQL Server 2008 R2 Express. I had some trouble and eventually ended up removing both SQL Server 2008 and SQL 2008 R2 Express and then reinstalling R2 Express. After doing so I couldn’t get Visual Basic 2010 Express to recognize my on-computer databases used with my applications. I get the error message "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed." It worked before I downloaded R2 Express.

    I can use R2 Express including Management Studio and make new databases, I can access my computer-based databases, but I don’t know how to get Visual Basic 2010 to work with it. I’m retired and use Microsoft’s Visual Basic 2010 Express, SQL Server 2008 R2 Express and Web Developer 2010 Express for my personal enjoyment. I have a personal website but don’t use a database with it, so I only use the server as a local-host for my Basic applications or projects; what do I need to do to use it as such?

    Saturday, July 31, 2010 12:46 AM

Answers

  • Hi BobOfCalif,

     

    Have you tried to delete this folder?

    C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

    This folder stores files for old instance of SQL Server 2008. I recommend that you delete it and try again.

     

    Meanwhile I would like to suggest that you check if User Instance is enabled.

    In order to check if User Instance is enabled, please open SQL Server Management Studio and connect to this instance, then execute this statement: sp_configure ‘user instances enabled’

    If User Instance is disabled, please use the following script to enable it and try again:

    sp_configure 'user instances enabled',1

    RECONFIGURE

     

    If anything is unclear, please let me know.

    • Marked as answer by BobOfCalif Wednesday, August 4, 2010 8:09 PM
    Wednesday, August 4, 2010 2:44 AM
  • Hi Bob,

     

    By default the AppData folder is a hidden folder, please paste the location I provided in my previous post to the location bar and replace the <user> with your user name, then press Enter key.

     

    Sp_configure is a system stored procedure, generally we could click “File | New | Database Engine Query” to open a new window and paste “sp_configure ‘user instance enabled'” into it, then we could press “F5” key to execute this statement.

     

    If anything is unclear, please let me know.

    • Marked as answer by BobOfCalif Wednesday, August 4, 2010 8:09 PM
    • Edited by Tom Li - MSFT Thursday, August 5, 2010 1:15 AM
    Wednesday, August 4, 2010 6:41 AM
  • Hi Tom Li,

    Wow! When I deleted all the files in the SQLEXPRESS folder, everything came back to life. I had read before that this folder should be deleted, but as you know I couldn’t find it. I can’t thank you enough for working with me through these many posts, and showing me some of the specifics of this system.

    Many thanks,

    BobOfCalif

    • Marked as answer by BobOfCalif Wednesday, August 4, 2010 8:01 PM
    Wednesday, August 4, 2010 8:00 PM

All replies

  • Hello,

    Please try the solutions posted by Harry Zhu (MSFT) on the following thread:

    http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/26e97d82-7f70-43f0-a163-ae9654a0188c

    If the above does not help, try this:

    http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/2bb249cb-c83a-43fc-b975-8fe9e8ef00f2

    I would like to share with you the following article also. You may find it interesting.

    http://support.microsoft.com/kb/2002980

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    Saturday, July 31, 2010 3:24 AM
  • Hi Alberto,

    Thank you for taking time to share with me the three sources of information in your post. I have looked over and tried some of the solutions suggested, some have been helpful, but have not solved my problem. I was especially interested in Microsoft’s explanation of the situation. I tried to adjust the ASP.NET situation and solution to my Visual Basic problem, but without success. This seems to be a recent problem they have encountered, so I hope that there will be some help from them in the near future.

    Again, thanks very much for your kind help,

    BobOfCalif

    Saturday, July 31, 2010 9:56 PM
  • Hi BobOfCalif,

     

    Did the instance of SQL Server 2008 R2 Express have an instance name “SQLEXPRESS”?

    By default, the instance used by Visual Studio to generate a User Instance should have an instance name “SQLEXPRESS” for it is set in Visual Studio. If the real instance name is not “SQLEXPRESS”, the Visual Studio 2010 will not find the corresponding instance and will generate an error.

     

    Therefore I recommend that you check if the real instance name is “SQLEXPRESS” or not. Please follow the steps to get the instance name:

    1.       Start SQL Server Configuration Manager

    2.       Click “SQL Server Services” in the left pane

    3.       In the right pane, please find out the service with name “SQL Server (<instance name>)” and remember the part inner angle bracket

     

    If it is not “SQLEXPRESS”, we have to modify the instance name used by Visual Basic 2010 Express to make it identical with the real instance. Please follow the steps below to set the instance name:

    1.       Start Visual Basic 2010 Express

    2.       Please click “Menu | Tools | Options…”

    3.       Expand “Database Tools | Data Connections”

    4.       Fill the textbox in the right with the real instance name

     

    If anything is unclear, please let me know.

    Tuesday, August 3, 2010 11:19 AM
  • Hi Tom,

    I followed your instructions and everything seems to be in order. In Configuration Manager: SQL SERVER(SQLEXPRESS) – Running – Automatic – LocalSystem and the Process ID = 1992.

    SQL Server Agent(SQLEXPRESS) and SQL Server Browser are stopped and when I try to start them the Start provision is faded out and unavailable.

    In Visual Basic 2010 Express the Database Tools | Data Connections = SQLEXPRESS.

    I forgot to mention that I’m using Windows 7 Professional OS.

    Thanks for your suggestions, be glad to hear from you anytime.

    BobOfCalif

    Tuesday, August 3, 2010 9:45 PM
  • Hi BobOfCalif,

     

    Have you tried to delete this folder?

    C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

    This folder stores files for old instance of SQL Server 2008. I recommend that you delete it and try again.

     

    Meanwhile I would like to suggest that you check if User Instance is enabled.

    In order to check if User Instance is enabled, please open SQL Server Management Studio and connect to this instance, then execute this statement: sp_configure ‘user instances enabled’

    If User Instance is disabled, please use the following script to enable it and try again:

    sp_configure 'user instances enabled',1

    RECONFIGURE

     

    If anything is unclear, please let me know.

    • Marked as answer by BobOfCalif Wednesday, August 4, 2010 8:09 PM
    Wednesday, August 4, 2010 2:44 AM
  • Hello again Tom Li,

    I didn’t do so good this time. When I tried C:\Users\<my name>\ there was no AppData folder. Then I tried C:\Users\Classic .NET AppPool\AppData\Local\Microsoft\ but there was no Microsoft SQL Server Data folder.

    I didn’t know what you meant by "Then execute this statement" so I opened SQL Server Management Studio and used SQL Server Powershell, but when I typed in sp_configure ‘user instances enabled’, I got an error message that started with "The term ‘sp_configure’ is not recognized, etc."

    I really appreciate your help Tom,

    Bob

    Wednesday, August 4, 2010 4:59 AM
  • Hi Bob,

     

    By default the AppData folder is a hidden folder, please paste the location I provided in my previous post to the location bar and replace the <user> with your user name, then press Enter key.

     

    Sp_configure is a system stored procedure, generally we could click “File | New | Database Engine Query” to open a new window and paste “sp_configure ‘user instance enabled'” into it, then we could press “F5” key to execute this statement.

     

    If anything is unclear, please let me know.

    • Marked as answer by BobOfCalif Wednesday, August 4, 2010 8:09 PM
    • Edited by Tom Li - MSFT Thursday, August 5, 2010 1:15 AM
    Wednesday, August 4, 2010 6:41 AM
  • Hi Tom Li,

    Wow! When I deleted all the files in the SQLEXPRESS folder, everything came back to life. I had read before that this folder should be deleted, but as you know I couldn’t find it. I can’t thank you enough for working with me through these many posts, and showing me some of the specifics of this system.

    Many thanks,

    BobOfCalif

    • Marked as answer by BobOfCalif Wednesday, August 4, 2010 8:01 PM
    Wednesday, August 4, 2010 8:00 PM
  • very helpful! thanx!!!
    Wednesday, March 14, 2012 2:12 PM