Login: Cannot Open Database?

From: Leigh (leigh46137@voyager.net)
Date: 03/25/03


From: leigh46137@voyager.net (Leigh)
Date: 25 Mar 2003 10:35:40 -0800


I have created a SQL database using SQL Server 2000. I created the
application to access the database using VB.NET. I created users and
roles in the database using enterprise manager. I can open the .aspx
pages and login to the database and do everything just fine on my
development machine.

I need to be able to run the application on my laptop to demonstrate
it.
MSDE is installed (and running); .NET Framework is installed; IIS is
installed (and running); The database has been copied to the laptop
(and attached); The application has been installed using a deployment
project; I have set the MSDE to use mixed authentication (not Windows
only)

I can go to a command prompt and access the database using osql.exe –E
and list records. I have added the logins using sp_addlogin on the
laptop – and I can list them, so I know they exist. When I try to run
sp_grantdbaccess, it tells me that the login is already associated
with the database (as I would expect).

I can open the login.aspx page, but when I try to login, I get the
error:
"Cannot open database requested in login ‘Client Equipment'. Login
Fails. Login failed for user ‘Jim'.

My login code looks like this:

    Private Sub cmdLogin_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdLogin.Click
        'Check Database Login
        Dim stInfo As String
        stInfo = "user id = " & Me.txtUserName.Text & ";password=" &
Me.txtPassword.Text

        'Set Connection string
            Me.SqlConnection1.ConnectionString = _
                "Data Source=(local);" & _
                "Initial Catalog = Client Equipment;" & stinfo
        Try
            Me.SqlConnection1.Open()
        Catch er As System.Data.SqlClient.SqlException
            Me.lblMsg.Text = er.Message
            Exit Sub
        End Try

        Me.lblMsg.Text = "Sucessful Login"
End sub

I have tried everything I can think of! Can anyone tell me what I'm
missing?



Relevant Pages

  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... modifications to the database as well (editors get update permission, ... As database connections are expensive to ... a certain visitor in the Session, and use that value to start the right ...
    (comp.lang.php)
  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... the postgres user they are logged in as to one that can make ... modifications to the database as well (editors get update permission, ... As database connections are expensive to ...
    (comp.lang.php)
  • RE: secure files
    ... to store the objects as BLOB's in the SQL database. ... Login procedure is with ssl ... I don't want to use nt user id's because then our clients must login ...
    (Focus-Microsoft)
  • RE: How to allow users to change their password?
    ... be set up to provide the Security dialog window for password changes. ... I'll have to login using their login ... > name/password first. ... See http://www.QBuilt.com for all your database needs. ...
    (microsoft.public.access.security)
  • Re: Please! Doesnt anyone know a better way to do this?
    ... account, they need to automatically be directed to the page to enter data ... session variable on the Account page. ... I assume here that you're checking a database when the user attempts to ... When a new user attempts to login or clicks to register, ...
    (microsoft.public.dotnet.framework.aspnet)