connect SQl server


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: connect SQl server

  1. #1
    Join Date
    Mar 2005
    Posts
    110

    connect SQl server

    hi guys,

    I have a new project working in the SQl SERVER. Now I connect the database using the following way ,it gave me an Error message: I canot connect connect the database. error number is 2147217843

    ****
    Set gAcnn = New ADODB.Connection
    strconnect = "Driver={SQL Server};DSN=DB2; server=192.168.0.5 ; Database=DBname;UID=sa;PWD=;"
    gAcnn.Open strconnect
    ****

    the system administrator configed the ODBC for me. DSN =DB2. server:192.168.0.5, Uid=sa .I donot know password.


    welcome any help

  2. #2
    Join Date
    Mar 2005
    Posts
    110
    hi, I tried 4 ways to connect. they donot work.

    'gAcnn.Open "Driver={SQL Server};" & _
    '"Server=192.168.0.5;" & _
    '"Database=Dbname;" & _
    '"Trusted_Connection=yes"

    'gAcnn.Open "Driver={SQL Server};" & _
    '"Server=192.168.0.5;" & _
    '"Database=Dbname;" & _
    '"Uid=sa;" & _
    '"Pwd="

    gAcnn.Open "Provider=sqloledb;" & _
    "Data Source=MYDSNNAME;" & _
    "server=192.168.0.5;" & _
    "Initial Catalog=ECMII;" & _
    "Integrated Security=SSPI"

    'gAcnn.Open "Provider=sqloledb;" & _
    '"Data Source=MYDSNNAME;" & _
    '"Initial Catalog=DBname;" & _
    '"User Id=sa;" & _
    '"Password="


    help me!

  3. #3
    Join Date
    Dec 2003
    Posts
    2,750
    Is the password for the sa account supposed to be blank? Is SQL Server set up for both SQL Server and Windows security (mixed mode)?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center