DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Connection to SQL Server using ADO

  1. #1
    Chris R. Guest

    Connection to SQL Server using ADO


    I'm trying to connect to a SQL Server db using ADO. My code looks like:
    hr = pConn->Open(L"Data Source=CDLCTest1",L"good",L"user",adLockPessimistic);

    I cannot connect using this. I've checked username,password to the nth degree
    and they're right. I've recreated my ODBC driver ("CDLCTest1") and double
    checked everything. I have an Access database set up which I can connect
    to just fine using the above syntax. Is the connection definition string
    wrong? Help Please!

  2. #2
    Mark C Guest

    Re: Connection to SQL Server using ADO


    "Chris R." <csparks@tenera.com> wrote:
    >
    >I'm trying to connect to a SQL Server db using ADO. My code looks like:
    > hr = pConn->Open(L"Data Source=CDLCTest1",L"good",L"user",adLockPessimistic);
    >
    >I cannot connect using this. I've checked username,password to the nth degree
    >and they're right. I've recreated my ODBC driver ("CDLCTest1") and double
    >checked everything. I have an Access database set up which I can connect
    >to just fine using the above syntax. Is the connection definition string
    >wrong? Help Please!


    Check your connection string.
    It should be something like...

    ODBC;DSN=CDLCTest1;UID=username;pwd=password



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