在进行使用Windows身份验证方式时,应该使用如下的字符串进行连接。其中的字段内容可以相应修改。否则会碰到连接字符串属性无效,或者多步OLE DB操作错误等问题。
CString szDBFilePath=“c://test.mdf”
m_szServerInfo="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=.//SQLEXPRESS;AttachDbFilename=";
m_szServerInfo+=szDBFilePath;
2951

被折叠的 条评论
为什么被折叠?



