0

i am doing an application at school and i always have this error message:

Cannot open database "users" requested by the login. The login failed. Login failed for user 'SERVER\Student'.

what is the possible solution for this? thanks :)

3
Contributors
3
Replies
20
Views
4 Years
Discussion Span
Last Post by Lethugs
0

this is my sqlconnection string that i used:

Dim conn As New SqlConnection("Server=SERVER/SQLEXPRESS;Database=users;integrated security=true;")
0

Try SERVER\SQLEXPRESS (back slash). When I connect to the SQLEXPRESS on my computer I use

JIM-PC\SQLEXPRESS

If you are connecting to a SQLEXPRESS on another machine then you will have to check that you have been granted access rights for you as currently logged on. If not then access rights will have to be set up (because you are using integrated security). Or you can use a userid/password that has been set up in SQLEXPRESS in which case you will have to specify the userid & password in the connection string.

0

Try to create a user id from sql management studio > security> logins node. Right click logins then new select new login. Grant needed permission to that user then change your connection string to

Dim conn As New SqlConnection("Server=youpcname\SQLEXPRESS;Database=users;User Id = yourcreatedlogin, Pass = yourpassword;")
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.