I got right the problem tonight RRS feed

  • General discussion


    I got right the problem tonight,after many hours,finally I found a success example from CSDN(a website like MSDN in China) .here is his code:


     _bstr_t strConnect ="Provider=SQLOLEDB.1;Data Source=(local);Integrated Security=sspi;Persist Security Info =FALSE;DataBase=student";


    and mine here:


    _bstr_t strConnect ="Provider = SQLOLEDB;Server = (local) ;Integrated Security = true;Persist Security Info =FALSE;DataBase=student"'  .(Because I learn ADO.NET in C# before C++ ,I got the habit of writing it this way:Integrated Security = true  and it was totally right in C#).


    as you can see there is just one diffrence between mine and his.And what made me crazy is ,I got the error all the time.

    Finally I chaged true to SSPI then I passed the cobime.


    It is quite strange that Microsoft made it this way,hard to understand,not close to perople's mind.It should be corrected I think.




    Monday, October 27, 2008 6:59 PM

All replies


    Giving to true to Integrated Security should be okay. Can you try to use "Provider=SQLOLEDB.1;DataSource=(local)..." instead of your original string "Provider=SQLOLEDB;Server=(local)..."?
    Monday, October 27, 2008 8:43 PM