CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    62

    XP in Workgroup- ADO won't connect to MSDE

    With 2 XP-pro machines in a common workgroup, the following code fails:

    pDBConnection.CreateInstance( __uuidof( ADODB::Connection );

    CString sConnect;
    sConnect.Format(_T("Provider=sqloledb;Data Source=%s;Initial Catalog='%s';uid='%s';pwd='%s';"), m_server, m_project, m_user, m_password);
    _bstr_t connectString = sConnect;
    m_pDBConnection->Open(connectString, "", "", 0);

    I'm simply trying to connect to an MSDE Server on 1 machine from another.

  2. #2
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: XP in Workgroup- ADO won't connect to MSDE

    Does the same code works if you run it on the same machine as the MSDE?
    Har Har

  3. #3
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    62

    Thumbs up Re: XP in Workgroup- ADO won't connect to MSDE

    No, and I'm glad you asked. After further scrutiny, it looks like the problem was my single quotes around the user, pwd, etc.

    Now it works on both the local and 'remote' machine. Thanks for the reply.

  4. #4
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: XP in Workgroup- ADO won't connect to MSDE

    Glad I could help. I've learned the hard way the lesson of starting with the simple things first.
    Last edited by PadexArt; June 13th, 2005 at 03:13 PM.
    Har Har

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured