View Single Post
  #7 (permalink)  
Old June 12th, 2003, 09:25 AM
johngilbart johngilbart is offline
Registered User
 
Join Date: Jun 2003
Location: asheville, nc, .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried the string Connection recommended above for OLE DB for SQL Server (To connect to SQL Server running on the same computer) and got an error "not a trusted SQL Server connection". The Usre ID was "sa" and password was "".

Assuming I want to stay with Windows Authentication instead of Mixed Mode, if I change sa password a non-blank password should a string connection like one the following work or is there more to do?

 ODBC Driver for SQL Server
For Standard Security

oConn.Open "Driver={SQL Server};" & _
           "Server=MyServerName;" & _
           "Database=myDatabaseName;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword"

For Trusted Connection security

oConn.Open "Driver={SQL Server};" & _
           "Server=MyServerName;" & _
           "Database=myDatabaseName;" & _
           "Uid=;" & _
           "Pwd="
' Or
oConn.Open "Driver={SQL Server};" & _
           "Server=MyServerName;" & _
           "Database=myDatabaseName;" & _
           "Trusted_Connection=yes"

To connect to SQL Server running on the same computer

oConn.Open "Driver={SQL Server};" & _
           "Server=(local);" & _
           "Database=myDatabaseName;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword"