SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Server, ADO, VB Connection
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bobbabuoy
Starting Member

USA
33 Posts

Posted - 11/29/2003 :  06:13:09  Show Profile  Visit bobbabuoy's Homepage  Reply with Quote
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"

conn.Open

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?

Thanks!

Merkin
Funky Drop Bear Fearing SQL Dude!

Australia
4970 Posts

Posted - 11/29/2003 :  06:36:55  Show Profile  Visit Merkin's Homepage  Reply with Quote
Hi

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.


Damian
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000