ADODB connection with SQL2000SP3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • liorh

    ADODB connection with SQL2000SP3

    my code is using ADODB connection to connect to SQL (Virtual) Server.

    the way it being done is (c++):

    ADODB::_Connect ionPtr m_dbConn;
    ADODB::_Records etPtr m_dbRst;
    m_dbConn.Create Instance(__uuid of(ADODB::Conne ction));
    m_dbRst.CreateI nstance( __uuidof( ADODB::Recordse t ));
    m_dbConn->ConnectionStri ng=( L"DSN=mydsn" );
    m_dbConn->Open("","sa"," ",-1);

    lately after installing SP3 over SQL2000, it was impossible to connect
    - the error message showed: login failed for user 'null)'. reason: not
    associated with a trusted sql server connection.

    so i changed the connection string to:
    m_dbConn-> ConnectionStrin g =(L"DSN=mydsn; UID=sa; PWD=;");
    m_dbConn->Open("",""," ",-1);

    and now it works !!

    what is the reason for that ?
    what in sql SP3 interrupt for this kind of connection ?
    what is the difference ?

  • Erland Sommarskog

    #2
    Re: ADODB connection with SQL2000SP3

    liorh (liorhal@gmail. com) writes:[color=blue]
    > my code is using ADODB connection to connect to SQL (Virtual) Server.
    >
    > the way it being done is (c++):
    >
    > ADODB::_Connect ionPtr m_dbConn;
    > ADODB::_Records etPtr m_dbRst;
    > m_dbConn.Create Instance(__uuid of(ADODB::Conne ction));
    > m_dbRst.CreateI nstance( __uuidof( ADODB::Recordse t ));
    > m_dbConn->ConnectionStri ng=( L"DSN=mydsn" );
    > m_dbConn->Open("","sa"," ",-1);
    >
    > lately after installing SP3 over SQL2000, it was impossible to connect
    > - the error message showed: login failed for user 'null)'. reason: not
    > associated with a trusted sql server connection.
    >
    > so i changed the connection string to:
    > m_dbConn-> ConnectionStrin g =(L"DSN=mydsn; UID=sa; PWD=;");
    > m_dbConn->Open("",""," ",-1);
    >
    > and now it works !!
    >
    > what is the reason for that ?
    > what in sql SP3 interrupt for this kind of connection ?
    > what is the difference ?[/color]

    Since I don't know what is in that DSN, I would have to guess a bit.
    Then again, I never liked DSNs. Anyway, my guess is that since SP3
    was very focused on security, it may be that since you did not provide
    a password, there is now a default for Windows authentication.

    Anyway, running a system with a blank password for 'sa' is extremely
    poor practice. So is it for that matter, to use sa to connect to SQL
    Server from an application.
    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server SP3 at
    Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

    Comment

    Working...