OLEDB CDataSource::OpenFromInitializationString doesn't take 'localhost' as 'Data Source=' RRS feed

  • Вопрос

  • I use the OLEDB from the <atldbcli.h>. I try to connect to the MSSQL database on my local computer. I try to call CDataSource::OpenFromInitializationString method. When I put the network name of my computer in the 'Data Source=xxxx' fragment the connection will open sucessfully. But when I put the 'localhost' then it failed.

    So, "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=mycomputer;Initial Catalog=FaceDetector" woks,

    but "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=localhost;Initial Catalog=FaceDetector" doesn't work.

    Does anybody knows why?

    20 сентября 2011 г. 13:56