0

I try to access a same database using two different system,

a) a window based system and
b) a web based system.

Both are using VB.NET. But it seem like the there is either one of them can access the database at a time. When one of them running, the other system unable to access. The error is

"Cannot open user default database. Login failed. Login failed for user 'PY1234\Jen'."

PY1234/Jen is a window authoization.
I was using MS SQL Sever Express 2005 and the connection string are

<connectionStrings>
<add name="WhyWhy.My.MySettings.BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bin\Debug\BookShop.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

As a conclusion i need the database to be connected by multiuser at the same time
Any help is appreciated.

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by kwan_kwan08
0

why are you attaching the database every time?

if you attach it, then the second user doesn't need to attach it since it's already there....

0

Dont run the Database everytime u try connecting to it.
Just run that once and establish the connection ,after that i dont think there would be a problem connecting multiusers to the same database.

0

Thank you for the reply.
I have try to change the connection string to

<connectionStrings>
<add name="WhyWhy.My.MySettings.BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=True;Connect Timeout=30;"
providerName="System.Data.SqlClient" />
</connectionStrings>

but it still cannot connect, i have change it to

<connectionStrings>
<add name="WhyWhy.My.MySettings.BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bin\Debug\BookShop.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"
providerName="System.Data.SqlClient" />
</connectionStrings>

Although it works for the time, could it be wrong? Coz i still need to attach the db everytime.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.