Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Visual Basic (VB 4/5/6) » Database Programming » Database login failed


Database login failedExpand / Collapse
Author
Message
Posted 8/6/2008 9:58:25 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/11/2008 10:04:55 PM
Posts: 3, Visits: 3

 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.

Post #25531
Posted 9/17/2008 8:36:03 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/14/2008 12:47:36 PM
Posts: 17, Visits: 20
Why are you attaching the same database file to the server with each connection? Your database should already be there; shouldn't it?

An example of a simple connection string to connect to an SQL Server should look like this:

"Data Source=SERVERNAME;Initial Catalog=DATABASENAME;Integrated Security=True"

connectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=BookShop;Integrated Security=True"

Post #25716
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Brian, Peter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 6:39am