安装后,打开页面时提示无法链接数据库

问题说明

报错信息:

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

重新启动一次sql express又可以成功连接。


软件版本:3.x    操作系统:xp    
leal  2008年4月9日
问题解答

这个问题好些是用普通帐号登录xp进行安装造成的。找到了一个解决办法:http://hi.baidu.com/fjwfly/blog/item/f319497fea9bcc0a29388ae3.html

Error: Failed to generate a user instance of SQL Server...

I was just hacking something together in Visual Web Developer Express, and was attempting to add a database to my App_Data directory when I ran into problems.

VWD kept timing out, and giving me a variety of error messages. Event Viewer contained the following: 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. [CLIENT: ]

I did some googling, and discovered the solution: you need to delete the C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS directory.

What everyone else failed to emphasise is that you might need to restart Windows. Simply bouncing the SQL Server Express service doesn't always fix it.

This is what I did:

  • Reboot the computer.
  • Log in as Administrator (I run with non-Admin privileges most of the time).
  • Delete the SQLEXPRESS directory for my normal user account.
  • Log back in as my normal user.

 

You can see if it's working properly by using the SSEUTIL utility. "sseutil -l" (that's a lower-case L) should list the databases currently being used by your user account.

 

 

还有种方面,都是从别人网站上弄的.:打开 SQL Server Configuration Manager 找到SQLEXPRESS,双击在build-in acount 中选择LOCAL SYSTEM. 重启服务.