void EnhancedVtoRouter::DoVtoRemoteConnectedChanged(bool aOpened)
{
	if(mRemoteConnected != aOpened) {
		LOG_BLOCK(LEV_INFO, "Remote connection: " << GetConnectionString(aOpened));
		mRemoteConnected = aOpened;
		this->HandleVtoRemoteConnectedChanged();
	}
}
void EnhancedVtoRouter::SetLocalConnected(bool aConnected)
{
	if(mLocalConnected != aConnected) {
		LOG_BLOCK(LEV_INFO, "Local connection: " << GetConnectionString(aConnected));
		mLocalConnected = aConnected;
		this->HandleSetLocalConnected();
		this->NotifyRemoteSideOfState(aConnected);
	}
}
Beispiel #3
0
void CADODatabase::dump_com_error(_com_error &e)
{
	CString ErrorStr;
	
	_bstr_t bstrSource(e.Source());
	_bstr_t bstrDescription(e.Description());
	ErrorStr.Format( "CADODataBase Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n",
		e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription);
	m_strErrorDescription = (LPCSTR)bstrDescription ;
	m_strLastError = _T("Connection String = " + GetConnectionString() + '\n' + ErrorStr);
	m_dwLastError = e.Error(); 
	#ifdef _DEBUG
		AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR );
	#endif
	throw CADOException(e.Error(), e.Description());
}
Beispiel #4
0
BOOL CV5App::InitDB()
{
	::CoInitialize(NULL);
	_bstr_t bstr=GetConnectionString();
	 HRESULT hr=m_pConnection.CreateInstance("ADODB.Connection");
	 if (SUCCEEDED(hr)>0)
	     return FALSE;
	 hr=m_pCommand.CreateInstance("ADODB.Command");
	 if (SUCCEEDED(hr)>0)
		 return FALSE;
	try{
	   m_pConnection->Open(bstr,"","",-1);
	   m_pCommand->ActiveConnection =m_pConnection;
	   return TRUE;
	}
	catch(_com_error e)
	{
		return FALSE;
	}
}
// ////////////////////////////////////////////////////////////////////////////
std::string DriverConnectParams::GetConnectionString() const
{
	std::string out_string;

	return(GetConnectionString(out_string));
}