Ole db connecting problem
-
dear all: I'm trying to use OLE DB to access the SQL Server instead of ODBC(MFC) which I was quite familar. Here is some simple codes I used to open data source: CString m_username,m_password; ... ... CDBProSet m_dbproset; m_dbproset.AddProperty(DBPROP_INIT_DATASOURCE,L"SQL_SERVER_HOSTNAME"); m_dbproset.AddProperty(DBPROP_AUTH_USERID,m_username); m_dbproset.AddProperty(DBPROP_AUTH_PASSWORD,m_password); m_dbproset.AddProperty(DBPROP_INIT_CATALOG,L"DEFAULT_DATABASE"); CDataSource m_datasource; m_datasource.Open(L"SQLOLEDB",&m_dbproset,1); When I call CDataSource::Open menthod I was informed that some OLE DB process make mistake. Can anyone tell me is there anything wrong with my codes or I missed sth? Thank you very much.
Lisoft
-
dear all: I'm trying to use OLE DB to access the SQL Server instead of ODBC(MFC) which I was quite familar. Here is some simple codes I used to open data source: CString m_username,m_password; ... ... CDBProSet m_dbproset; m_dbproset.AddProperty(DBPROP_INIT_DATASOURCE,L"SQL_SERVER_HOSTNAME"); m_dbproset.AddProperty(DBPROP_AUTH_USERID,m_username); m_dbproset.AddProperty(DBPROP_AUTH_PASSWORD,m_password); m_dbproset.AddProperty(DBPROP_INIT_CATALOG,L"DEFAULT_DATABASE"); CDataSource m_datasource; m_datasource.Open(L"SQLOLEDB",&m_dbproset,1); When I call CDataSource::Open menthod I was informed that some OLE DB process make mistake. Can anyone tell me is there anything wrong with my codes or I missed sth? Thank you very much.
Lisoft
Maybe if you posted the actual error message someone could help... Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed. Carl Sandburg