Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help! Cannot connect to Database, login failed..

Author  Topic 

matthew5
Starting Member

4 Posts

Posted - 2008-01-31 : 16:48:29
Help! Cannot connect to Database, login failed for user...
I have been looking for a fix for this for some time, however I have yet to find one. I am running msde-2000 and I have a programm that I wrote with VB.Net 2003 that works fine when I am in Debug Mode, however when I deploy the application, and try to connect to the MSDE SQL-Server I get an error that states, "Cannont Connect to database TCON1, Login failed for user Amanda,

Please someone help!...

Thanks,

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2008-01-31 : 17:00:53
My guess is the password is wrong, or the user Amanda doesn't exist.


Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page

hey001us
Posting Yak Master

185 Posts

Posted - 2008-01-31 : 17:08:18
OR
how you are getting your connection string? may be its getting wrong connection string. check if you are getting a connection based on configuration manager

hey
Go to Top of Page

matthew5
Starting Member

4 Posts

Posted - 2008-01-31 : 19:29:03
You guys are good, really fast replies, Amanda does exist, she is my wife...., and it is her account that I am trying to install the application on. She does have admin rights, however here is my connection string.

Dim dbcon As System.Data.SqlClient.SqlConnection = _
New System.Data.SqlClient.SqlConnection("Data Source =mdp-55\whatup1;" + _
"Initial Catalog=Tcon1; Trusted_Connection=yes")


mdp-55 is the computer name, and whatup1 is the SERVER Name, Tcon1 is the database name.
Any help is greatly, greatly appreciated, as I have been looking around the web for awhile about this topic. I was thinking that it could be that I do not specify a password in my connection, however I thought that I could put TRUSTED_CONNECTION=YES and that would be fine.

Thanks

Go to Top of Page

matthew5
Starting Member

4 Posts

Posted - 2008-01-31 : 19:37:28
configuration manager? I am pretty good with these terms, however where do I find the configuration manager. Is this when I initially set up msde, (Configuration), or its probably in my vb.net program, correct?
Go to Top of Page

matthew5
Starting Member

4 Posts

Posted - 2008-01-31 : 19:50:13

You know what I just thought about it, and I wanted to be crystal clear, my connnection string is embedded in my code, like this

Dim dbcon As System.Data.SqlClient.SqlConnection = _
New System.Data.SqlClient.SqlConnection("Data Source =mdp-55\whatup1;" + _
"Initial Catalog=Tcon1; Trusted_Connection=yes")

Try

Dim com As SqlCommand = New SqlCommand( _
"Select Count(*) From System_Table where ID_Number = @Rec", _
dbcon)
com.Parameters.Add("@Rec", rec)
dbcon.Open()
RR = CType(com.ExecuteScalar(), Integer)
dbcon.Close()

strwr.WriteLine("CHECKDUPRECORDS method initially found " & RR & " records")

Basically its a pretty simplistic application that connects to only 1 database, and it is just used for keeping some important records.

Let me know if you need anymore details, I really would like to know how to fix this, although its really not a rush as if you did not know this is for my practice, and any help would be greatly appreciated.

This was me the other night when I was looking all over the web for the answer for this,

thanks again.

Go to Top of Page
   

- Advertisement -