Please start any new threads on our new site at 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)
 SQL Server, ADO, VB Connection

Author  Topic 

Starting Member

33 Posts

Posted - 2003-11-29 : 06:13:09
I am running a vb app that accesses a sql server db on my machine. I also access the same db from some web apps using a dsn connection and it works just fine. However, I am having trouble connecting with the db in my vb app. I could do it using an adodc object but I need to do it in code.

The code I was using (and was working) hasn't changed but we moved our physical office and now it no longer works. I get an SSPI error. Here is the code:

Set conn = New ADODB.Connection

conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;UID=sa;Pwd=somepassword;Data Source=MyServer"


I have no idea what the problem might be. My sql server is set up in mixed mode so it should let me in with my Windows login OR with the username and password that I have in there. Any ideas where the problem might be?


Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-11-29 : 06:36:55

Take out the Integrated Security=SSPI; part if you want to use SQL authentication, you don't need it.

Also, it's not good form to use SA to connect to your database.

Go to Top of Page

- Advertisement -