CADO 2 file .ccp #include "stdafx.h" #include "ADO.h" CADO::CADO() { m_pConn = NULL; m_bIsConnected = NULL; m_pRset = NULL; m_hresult = S_OK; } CADO::~CADO() { if(m_bIsConnected) { m_pConn->Close(); CoInitialize(NULL); } } //***************************************************************// BOOL CADO::Connect(char *szDBServerIP, char *szDBName, char *szUserID, char *szUserPW) { if(m_bIsConnected) { printf("DB is already connected!\n"); return TRUE; } char szCon[256]; memset(szCon, 0x00, sizeof(szCon)); sprintf(szCon, "Provider=SQLOLEDB;Data Source=%s; Initial catalog=%s;User ID=%s;Password=%s;", szDBServerIP, szDBName, szUserID, szUserPW); //Initialize the COM Library CoInitialize(NULL); m_hresult = m_pConn.CreateInstance((__uuidof(Connection))); if(FAILED(m_hresult)) { printf("Error instantiating Connection object\n"); CoUninitialize(); return FALSE; } m_hresult = ...