Login: Cannot Open Database?
From: Leigh (leigh46137@voyager.net)
Date: 03/25/03
- Next message: Marten Engblom: "Passing Client Certificate from asp.net app"
- Previous message: Dennis Andersen: "Re: Authentication not running -- how to debug?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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?
- Next message: Marten Engblom: "Passing Client Certificate from asp.net app"
- Previous message: Dennis Andersen: "Re: Authentication not running -- how to debug?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|