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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Login failed error

Author  Topic 

shaminda
Starting Member

25 Posts

Posted - 2004-10-07 : 15:56:11
One of my VB.Net programs would not connect to SQL Server. I get the following error when I try to connect to server.

Login failed for user ‘HQPROD\honlot’.

I can login as my self and run the program without any problem. On the client pc user ‘honlot’ has administrative rights. On the Windows 2000 server ‘honlot is a member of Administrators. On the SQL Server 2000 honlot has db owner permissions to the all the databases. HQPROD is the name of our domain. The PC that’s try to connect to is part of the WORKGROUP group, but not part of the domain. Why is it saying login failed for ‘HQPROD\honlot’ with domain name attached to user name. How do I have to do to connect SQL server?

__madmax__
Starting Member

31 Posts

Posted - 2004-10-07 : 16:06:37
what's the authentication mode of the SQL server ? SQL, Windows or Mixed mode ? maybe that helps ?
Go to Top of Page

shaminda
Starting Member

25 Posts

Posted - 2004-10-07 : 16:07:18
mixed mode
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-07 : 16:21:55
You need to specify SQL authentication and not Windows authentication. You do this in your connection string.

BTW, Windows authentication is recommended. It is more secure. Windows authentication would be your domain account.

Tara
Go to Top of Page

shaminda
Starting Member

25 Posts

Posted - 2004-10-08 : 10:34:09
Tara,
I think my problem is in the connection string. Here is the connection string I use to connect to a database in VB 6.0.

ConnectString=Provider=SQLOLEDB.1;Persist Security Info=true;User ID=honlot;Password="";Initial Catalog=LotCtrlS9V;Data Source=sqlv

I tried to use the same connection string in VB.net but it didn’t work. So I changed the connection string to this:

ConnectString=Server=SQLV;Database=LotCtrlS9V;Integrated Security=True

How should I update this connection string to work with my VB.Net program and use SQL Server authentication?

Also my development pc is using TCP/IP protocol. And the workstation is Named Pipes. I don’t know how to change it to TCP/IP since SQL server is not installed on the Workstation. Could this be a problem?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-08 : 12:25:19
Integrated Security=True means to used Windows authentication, which apparently is not what you want.

Tara
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-10 : 09:49:56
quote:
Originally posted by shaminda

Tara,
I think my problem is in the connection string. Here is the connection string I use to connect to a database in VB 6.0.

ConnectString=Provider=SQLOLEDB.1;Persist Security Info=true;User ID=honlot;Password="";Initial Catalog=LotCtrlS9V;Data Source=sqlv




from the err message, you're using windows authentication, use:
ConnectString="Provider=SQLOLEDB.1;integrated security=sspi;trusted connection=yes;Initial Catalog='LotCtrlS9V';Data Source='sqlv'"

if standard login:
ConnectString="Provider=SQLOLEDB.1;Persist Security Info=true;User ID='honlot';Password='passwordhere';Initial Catalog='LotCtrlS9V';Data Source='sqlv'"

hope this helps...

Go to Top of Page

shaminda
Starting Member

25 Posts

Posted - 2004-10-13 : 09:24:39
I changed my coneection string to the following and it works now.

ConnectString=Persist Security Info=true;User ID=honlot;Password="";Initial Catalog=LotCtrlS9V;Data Source=sqlv

Thank you all for your help.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-13 : 22:14:57
quote:
Originally posted by shaminda

I changed my coneection string to the following and it works now.

ConnectString=Persist Security Info=true;User ID=honlot;Password="";Initial Catalog=LotCtrlS9V;Data Source=sqlv

Thank you all for your help.



so it was your provider then...

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -