Attachdbfilename的密钥无效 [英] Invalid Key for attachdbfilename

查看:90
本文介绍了Attachdbfilename的密钥无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用SQL Server DB.连接字符串为

Hi,
I am using SQL Server DB. The connection string is

Data Source=office1\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dbSQLTest.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True



在本地计算机上就可以了.在网络计算机上,它给出了
"Invalid Key for attachdbfilename"

我不想制作服务器客户端应用程序.我使用Sql服务器数据库的目的是在3-4台计算机上同时运行我的应用程序.我只是将快捷方式从主计算机连接到网络计算机.
我不附加服务器实例的原因是,用户很难将DB与服务器附加,然后再管理SSMS.
请指教
谢谢
Furqan



On local computer it is fine. On the network computer, it gives
"Invalid Key for attachdbfilename"

I do not want to make server client application. My purpose to use Sql server DB is to run my application on 3-4 computer simultaneously. I just make shortcut from my main computer to the network computers.
The reason why I donot attach with server instance is that it is difficult for the users to attach DBs with server and then manage SSMS.
Please advise
Thanks
Furqan

推荐答案

AttachDbFilename选项用于将数据库附加到SQL Server实例,并在分发数据库时使用,即制作数据库文件的副本并将其放置在客户端计算机上.

无论何时运行应用程序,都会以用户凭据作为服务帐户运行SQLEXPRESS实例,并加载数据库,使用户自动成为sysadmin.

如果要在中央位置存储数据库的单个副本,那么这不是一个好的选择.

另外,我也没有明白为什么用户必须在服务器上附加数据库?是一次工作,对吧?
The AttachDbFilename option used to attach a database to an instance of SQL Server and is used when you distribute your database, i.e make copies of database files and put them on client machines.

When ever your application is run, an instance of SQLEXPRESS is run with the user credentials as service account and the database is loaded making the user automatically a sysadmin.

If you want a single copy of the database at a central location, then this is not a good option.

Also I did not get the point why do the users have to attach DBs on a server? It is a one time job, right?


这篇关于Attachdbfilename的密钥无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆