#include "StdAfx.h" #include "AdoImpl_2.h" AdoImpl::AdoImpl(void) { m_pADODatabase = NULL; memset(m_szConnectString, 0, 1024); InitializeCriticalSection(&m_csAdo); } AdoImpl::~AdoImpl(void) { DeleteCriticalSection(&m_csAdo); } void AdoImpl::SetConnectString( IN const int &nType, IN LPCTSTR lpDataSource, IN LPCTSTR lpDatabaseTCPPort, IN LPCTSTR lpDatabaseAccount, IN LPCTSTR lpDatabasePassWord, IN LPCTSTR lpDatabaseName, IN LPCTSTR lpDatabaseFile) { switch (nType) { case ADO_ACCESS97: _stprintf_s(m_szConnectString, _T("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=%s"), lpDatabaseFile); break; case ADO_ACCESS2000: _stprintf_s(m_szConnectString, _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s"), lpDatabaseFile); break; case ADO_ACCESS2007: _stprintf_s(m_szConnectString, _T("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%s"), lpDatabaseFile); break; case ADO_SQLSERVER: { if ( !_tcsicmp(lpDatabaseTCPPort, _T("0"))) { //sprintf(m_szConnectString, "Provider=sqloledb.1;Persist Security Info=false;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; ", _stprintf_s(m_szConnectString, _T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; "), lpDataSource, // IP地址或服务名称; lpDatabaseName, lpDatabaseAccount, lpDatabasePassWord); } else { //sprintf(m_szConnectString, "Provider=sqloledb.1;Persist Security Info=false;Data Source=%s,%s;Initial Catalog=%s;User Id=%s;Password=%s; ", _stprintf_s(m_szConnectString, _T("Provider=sqloledb;Data Source=%s,%s;Initial Catalog=%s;User Id=%s;Password=%s; "), lpDataSource, // IP地址或服务名称; lpDatabaseTCPPort, lpDatabaseName, lpDatabaseAccount, lpDatabasePassWord); } } break; case ADO_PGSQL: { _stprintf_s(m_szConnectString, _T("DRIVER={PostgreSQL ODBC Driver(UNICODE)}; SERVER=%s; port=%s; DATABASE=%s; UID=%s; PWD=%s;"), lpDataSource, // IP地址或服务名称; lpDatabaseTCPPort, lpDatabaseName, lpDatabaseAccount, lpDatabasePassWord); } break; default: break; } } BOOL AdoImpl::IsOpen() { if ( m_pADODatabase == NULL) return FALSE; return m_pADODatabase->IsOpen(); } BOOL AdoImpl::Opendatabase(IN LPCTSTR lpConnectString /* = NULL */) { BOOL bResult = FALSE; if( NULL == m_pADODatabase ) { m_pADODatabase = new CADODatabase(); if( m_pADODatabase ) { if( lpConnectString == NULL ) { m_pADODatabase->SetConnectionString(m_szConnectString); } else { m_pADODatabase->SetConnectionString(lpConnectString); _tcscpy_s(m_szConnectString, lpConnectString); } if( TRUE == m_pADODatabase->Open() ) { //LOG4C((LOG_NOTICE, "Database Connetion Success!")); bResult = TRUE; } else { if( m_pADODatabase->IsOpen() ) { m_pADODatabase->Close(); } delete m_pADODatabase; m_pADODatabase = NULL; //LOG4C((LOG_NOTICE, "Database Connetion Lost!")); } } } return bResult; } void AdoImpl::Closedatabase() { if( NULL != m_pADODatabase ) { if( m_pADODatabase->IsOpen() ) { m_pADODatabase->Close(); } if( m_pADODatabase ) delete m_pADODatabase; m_pADODatabase = NULL; } } void AdoImpl::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format(_T("CADORecordset Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription ); m_strLastError = _T("Query = " + GetQuery() + '\n' + ErrorStr); m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox( ErrorStr, MB_OK | MB_ICONERROR ); #endif } int AdoImpl::Execute(IN LPCTSTR lpSQL) { INT iRetCode = 0; if( NULL == m_pADODatabase ) { //LOG4C((LOG_NOTICE, "NULL == m_pADODatabase" )); return -1; } try { EnterCriticalSection(&m_csAdo); if ( m_pADODatabase->IsOpen() ) { iRetCode = m_pADODatabase->Execute(lpSQL); LeaveCriticalSection(&m_csAdo); } else { LeaveCriticalSection(&m_csAdo); //LOG4C((LOG_NOTICE, "m_pADODatabase->IsOpen() = false" )); return -1; } } catch (_com_error &e) { dump_com_error(e); //LOG4C( ( LOG_ERROR, "Execute SQL Script Error, Script:%s, ErrorMsg:%s", pSql, e.ErrorMessage() ) ); }// end catch (_com_error &e) return iRetCode; } void AdoImpl::DeleteADORecordSet(CADORecordset* pRSet) { CloseADORecordSet(pRSet); if( pRSet ) { delete pRSet; pRSet = NULL; } } BOOL AdoImpl::OpenADORecordSet(IN CADORecordset *pRSet, IN LPCTSTR lpSQL) { int iRetCode; BOOL bResult = TRUE; if( NULL == pRSet ) return false; try { iRetCode = pRSet->Open(lpSQL, CADORecordset::openQuery); if (iRetCode == 0) { DeleteADORecordSet(pRSet); bResult = FALSE; } } catch (_com_error &e) { dump_com_error(e); //LOG4C( ( LOG_ERROR, "Execute SQL Script Error, Script:%s, ErrorMsg:%s", pSql, e.ErrorMessage() ) ); DeleteADORecordSet(pRSet); bResult = FALSE; }// end catch (_com_error &e) return bResult; } void AdoImpl::CloseADORecordSet(CADORecordset* pRSet) { if( NULL != pRSet ) { if( pRSet->IsOpen() ) { pRSet->Close(); } } } bool AdoImpl::GetADODateBaseStatus() { if( NULL == m_pADODatabase || !m_pADODatabase->IsOpen()) return false; return true; } DWORD AdoImpl::GetTableRecordCount(IN LPCTSTR lpTableName, IN LPCTSTR lpFilters) { if ( lpTableName == NULL) return -1; TCHAR szSQL[1024] = _T(""); if(lpFilters == NULL || _tcscmp(lpFilters,_T("")) == 0) _stprintf_s(szSQL,_T("select count(*) as cot from %s"),lpTableName); else _stprintf_s(szSQL,_T("select count(*) as cot from %s where %s"),lpTableName,lpFilters); DWORD nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; //AutoThreadSection aSection(&s_critSection); EnterCriticalSection(&m_csAdo); bResult = GetADODateBaseStatus(); if( FALSE == bResult ) { LeaveCriticalSection(&m_csAdo); return -1; } CADORecordset* pRSet = new CADORecordset(m_pADODatabase); if( NULL == pRSet ) { LeaveCriticalSection(&m_csAdo); //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL")); return -1; } bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { LeaveCriticalSection(&m_csAdo); //LOG4C((LOG_NOTICE, "GetFieldValueList1 OpenADORecordSet <%s>", pSql)); DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull(_T("cot")) ) { pRSet->GetFieldValue(_T("cot"), nRecordCount); } else { nRecordCount = -1; }// end if( !pRSet->IsFieldNull(0) ) DeleteADORecordSet(pRSet); LeaveCriticalSection(&m_csAdo); return nRecordCount; } /************************************************************************/ /* 函数:GetFieldValueList[4/12/2016 IT]; /* 描述:获取指定表查询字段的条件记录集; /* 参数:; /* [IN] lpTableName:要查询的表; /* [IN] lpFields:要查询的字段; /* [IN] lpFilters:查询的条件; /* [IN] dwCallBackType:回调函数类型; /* [IN] lpCallBack:回调函数指针; /* [INOUT] lpParamter:传递给回调函数的参数; /* 返回:成功查询返回记录数, 参数错误返回-1; /* 注意:; /* 示例:; /* /* 修改:; /* 日期:; /* 内容:; /************************************************************************/ int AdoImpl::GetFieldValueList(IN LPCTSTR lpTableName, IN LPCTSTR lpFields, IN LPCTSTR lpFilters, IN const DWORD &dwCallBackType, IN LPVOID lpCallBack, IN OUT LPVOID lpParamter) { if ( lpCallBack == NULL || lpParamter == NULL ) return -1; if ( lpTableName == NULL || lpTableName[0] == _T('\0') || lpFields == NULL || lpFields[0] == _T('\0')) return -1; int nRecordCount = 0; BOOL bResult = FALSE; TCHAR szSQL[2048] = _T(""); // 长度可能会不够,_stprintf_s结果导致SQL语句不正确; if ( lpFilters && lpFilters[0] != _T('\0') ) { _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), lpTableName, lpFilters); } else { _stprintf_s(szSQL, _T("select count(*) as cot from %s"), lpTableName); } EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( FALSE == bResult ){ LeaveCriticalSection( &m_csAdo ); return -1; } // 获取记录数; CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) return -1; bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ){ DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull(_T("cot")) ) { pRSet->GetFieldValue(_T("cot"), nRecordCount); } else { nRecordCount = -1; // 没有记录则返回; DeleteADORecordSet(pRSet); return -1; } DeleteADORecordSet(pRSet); // 获取查询记录集; pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) return -1; if ( lpFilters && lpFilters[0] != _T('\0') ) _stprintf_s(szSQL, _T("select %s from %s where %s"), lpFields, lpTableName, lpFilters); else _stprintf_s(szSQL, _T("select %s from %s"), lpFields, lpTableName); bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } //int nFieldCount = pRSet->GetFieldCount(); // 让回调函数处理返回的数据集结果; nRecordCount = ((RecordsetCallback)lpCallBack)(dwCallBackType, lpParamter, nRecordCount, pRSet); DeleteADORecordSet(pRSet); return nRecordCount; } int AdoImpl::GetFieldValueList(IN LPCTSTR lpTableName ,IN LPCTSTR lpFilters, IN LPCTSTR lpSql, OUT INT &nFieldCount, __out vector& vtRet) { TCHAR szSQL[1024] = _T(""); _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), lpTableName, lpFilters); int nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( false == bResult ) { LeaveCriticalSection( &m_csAdo ); return -1; } CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL")); return -1; } bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull(_T("cot")) ) { pRSet->GetFieldValue(_T("cot"), nRecordCount); } else { nRecordCount = -1; }// end if( !pRSet->IsFieldNull(0) ) DeleteADORecordSet(pRSet); pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL")); return -1; } bResult = OpenADORecordSet(pRSet, lpSql); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } nFieldCount = pRSet->GetFieldCount(); #if 0 for( int i = 0; i < nRecordCount; i++ ) { for ( int n = 0; n < nFieldCount; n++) { if( !pRSet->IsFieldNull(n) ) { pRSet->GetFieldValue(n, vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.insert(vtRet.end(), _T("")); //LOG4C((LOG_NOTICE, "GetFieldValueList1 list1 is NULL")); }// end if( !pRSet->IsFieldNull(0) ) } pRSet->MoveNext(); }// end for( int i = 0; i < nRecordCount; i++ ) #else for( int i = 0; i < nRecordCount*nFieldCount; i++ ) { if( !pRSet->IsFieldNull(i%nFieldCount) ) { pRSet->GetFieldValue(i%nFieldCount, vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.insert(vtRet.end(), _T("")); } if ((i != 0) && (i%nFieldCount == 0)) pRSet->MoveNext(); } #endif DeleteADORecordSet(pRSet); return nRecordCount; } int AdoImpl::GetFieldValueList(IN LPCTSTR lpTableName ,IN LPCTSTR lpSql, OUT int &nFieldCount, OUT CArray& strArray) { int nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( FALSE == bResult ) { LeaveCriticalSection( &m_csAdo ); return -1; } CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL")); return -1; } #if 0 TCHAR szSQL[1024] = _T(""); sprintf(szSQL,"select count(*) as cot from %s",pTableName); bResult = OpenADORecordSet(pRSet, szSQL); if( false == bResult ) { DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull("cot") ) { pRSet->GetFieldValue("cot", nRecordCount); } else { nRecordCount = -1; }// end if( !pRSet->IsFieldNull(0) ) DeleteADORecordSet(pRSet); //-------------------------------------------------------------------- pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL")); return -1; } #endif bResult = OpenADORecordSet(pRSet, lpSql); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } nRecordCount = pRSet->GetRecordCount(); nFieldCount = pRSet->GetFieldCount(); #if 1 #if 1 strArray.SetSize(nRecordCount,1); for( int i = 0; i < nRecordCount; i++ ) { for ( int n = 0; n < nFieldCount; n++) { if( !pRSet->IsFieldNull(n) ) { pRSet->GetFieldValue(n, vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); strArray.ElementAt(i).Add(strFieldValue.c_str()); } else { strArray.ElementAt(i).Add(_T("")); //LOG4C((LOG_NOTICE, "GetFieldValueList1 list1 is NULL")); }// end if( !pRSet->IsFieldNull(0) ) } pRSet->MoveNext(); }// end for( int i = 0; i < nRecordCount; i++ ) #else strArray.SetSize(nRecordCount,1); int nIndex = 0; for( int i = 0; i < nRecordCount*nFieldCount; i++ ) { if( !pRSet->IsFieldNull(i%nFieldCount) ) { pRSet->GetFieldValue(i%nFieldCount, vtFieldValue); string strFieldValue = string((char*)(_bstr_t)vtFieldValue); //vtRet.push_back(strFieldValue); strArray.ElementAt(nIndex).Add(strFieldValue.c_str()); } else { strArray.ElementAt(nIndex).Add(""); }// end if( !pRSet->IsFieldNull(0) ) if ((i != 0) && (i%nFieldCount == 0)) { nIndex++; pRSet->MoveNext(); } }// end for( int #endif #endif DeleteADORecordSet(pRSet); return nRecordCount; } int AdoImpl::GetClientServiceViewData(IN LPCTSTR lpSql, OUT CArray& strArray,IN LPCTSTR lpFilters/* =NULL */) { int nFieldCount = 0; int nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( false == bResult ) { LeaveCriticalSection( &m_csAdo ); return -1; } nRecordCount = GetTableRecordCount(_T("clientserviceview"), lpFilters); CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } TCHAR szSQL[1024] = _T(""); if(lpFilters && (_tcscmp(lpFilters,_T("")) != 0)) _stprintf_s(szSQL, _T("%s where %s"), lpSql, lpFilters); else _stprintf_s(szSQL,_T("%s"), lpSql); bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } //nRecordCount = pRSet->GetRecordCount(); nFieldCount = pRSet->GetFieldCount(); strArray.SetSize(nRecordCount,1); for( int i = 0; i < nRecordCount; i++ ) { if( !pRSet->IsFieldNull(_T("dindanid")) ) { pRSet->GetFieldValue(_T("dindanid"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); strArray.ElementAt(i).Add(strFieldValue.c_str()); } else { strArray.ElementAt(i).Add(_T("")); } if( !pRSet->IsFieldNull(_T("name1")) ) { pRSet->GetFieldValue(_T("name1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); strArray.ElementAt(i).Add(strFieldValue.c_str()); } else { strArray.ElementAt(i).Add(_T("")); } pRSet->MoveNext(); }// end for( int i = 0; i < nRecordCount; i++ ) DeleteADORecordSet(pRSet); return nRecordCount; } int AdoImpl::GetTbl_dindan_Values(IN LPCTSTR lpTableName, IN LPCTSTR lpFilters, IN LPCTSTR lpSql, INT &nFieldCount, OUT vector& vtRet) { TCHAR szSQL[1024] = _T(""); if(lpFilters == NULL || _tcscmp(lpFilters,_T("")) == 0) _stprintf_s(szSQL,_T("select count(*) as cot from %s"),lpTableName); else _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), lpTableName, lpFilters); int nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( FALSE == bResult ) { LeaveCriticalSection( &m_csAdo ); return -1; } CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull(_T("cot")) ) { pRSet->GetFieldValue(_T("cot"), nRecordCount); } else { nRecordCount = -1; }// end if( !pRSet->IsFieldNull(0) ) DeleteADORecordSet(pRSet); pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } bResult = OpenADORecordSet(pRSet, lpSql); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } nFieldCount = pRSet->GetFieldCount(); for ( int i = 0; i < nRecordCount; i++) { if( !pRSet->IsFieldNull(_T("id")) ) { pRSet->GetFieldValue(_T("id"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("money1")) ) { pRSet->GetFieldValue(_T("money1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("money2")) ) { pRSet->GetFieldValue(_T("money2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("money3")) ) { pRSet->GetFieldValue(_T("money3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("name1")) ) { pRSet->GetFieldValue(_T("name1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("name2")) ) { pRSet->GetFieldValue(_T("name2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("taoxiid")) ) { pRSet->GetFieldValue(_T("taoxiid"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("taoxiname")) ) { pRSet->GetFieldValue(_T("taoxiname"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("taoxijiage")) ) { pRSet->GetFieldValue(_T("taoxijiage"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("taoxizs")) ) { pRSet->GetFieldValue(_T("taoxizs"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time1")) ) { pRSet->GetFieldValue(_T("time1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time2")) ) { pRSet->GetFieldValue(_T("time2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time3")) ) { pRSet->GetFieldValue(_T("time3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bm")) ) { pRSet->GetFieldValue(_T("bm"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("ren")) ) { pRSet->GetFieldValue(_T("ren"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("discount")) ) { pRSet->GetFieldValue(_T("discount"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed1")) ) { pRSet->GetFieldValue(_T("payed1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed2")) ) { pRSet->GetFieldValue(_T("payed2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed3")) ) { pRSet->GetFieldValue(_T("payed3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed4")) ) { pRSet->GetFieldValue(_T("payed4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed5")) ) { pRSet->GetFieldValue(_T("payed5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time4")) ) { pRSet->GetFieldValue(_T("time4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time5")) ) { pRSet->GetFieldValue(_T("time5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("takezs")) ) { pRSet->GetFieldValue(_T("takezs"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("choosezs")) ) { pRSet->GetFieldValue(_T("choosezs"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status")) ) { pRSet->GetFieldValue(_T("status"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("clothescount2")) ) { pRSet->GetFieldValue(_T("clothescount2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("outside2")) ) { pRSet->GetFieldValue(_T("outside2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("style")) ) { pRSet->GetFieldValue(_T("style"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed3time")) ) { pRSet->GetFieldValue(_T("payed3time"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed4ren")) ) { pRSet->GetFieldValue(_T("payed4ren"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("payed4time")) ) { pRSet->GetFieldValue(_T("payed4time"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status2")) ) { pRSet->GetFieldValue(_T("status2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status3")) ) { pRSet->GetFieldValue(_T("status3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter1")) ) { pRSet->GetFieldValue(_T("waiter1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter2")) ) { pRSet->GetFieldValue(_T("waiter2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter3")) ) { pRSet->GetFieldValue(_T("waiter3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter4")) ) { pRSet->GetFieldValue(_T("waiter4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bz")) ) { pRSet->GetFieldValue(_T("bz"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("taketime")) ) { pRSet->GetFieldValue(_T("taketime"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("clothescount")) ) { pRSet->GetFieldValue(_T("clothescount"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("outside")) ) { pRSet->GetFieldValue(_T("outside"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bz2")) ) { pRSet->GetFieldValue(_T("bz2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bz3")) ) { pRSet->GetFieldValue(_T("bz3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("urgent")) ) { pRSet->GetFieldValue(_T("urgent"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status4")) ) { pRSet->GetFieldValue(_T("status4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status5")) ) { pRSet->GetFieldValue(_T("status5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter5")) ) { pRSet->GetFieldValue(_T("waiter5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter6")) ) { pRSet->GetFieldValue(_T("waiter6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("pinyin1")) ) { pRSet->GetFieldValue(_T("pinyin1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("pinyin2")) ) { pRSet->GetFieldValue(_T("pinyin2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter7")) ) { pRSet->GetFieldValue(_T("waiter7"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status6")) ) { pRSet->GetFieldValue(_T("status6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("phone1")) ) { pRSet->GetFieldValue(_T("phone1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("phone2")) ) { pRSet->GetFieldValue(_T("phone2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status7")) ) { pRSet->GetFieldValue(_T("status7"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("memberno")) ) { pRSet->GetFieldValue(_T("memberno"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter8")) ) { pRSet->GetFieldValue(_T("waiter8"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time6")) ) { pRSet->GetFieldValue(_T("time6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("status8")) ) { pRSet->GetFieldValue(_T("status8"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bruncount")) ) { pRSet->GetFieldValue(_T("bruncount"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("tichenren1")) ) { pRSet->GetFieldValue(_T("tichenren1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("tichenren2")) ) { pRSet->GetFieldValue(_T("tichenren2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("tichenren3")) ) { pRSet->GetFieldValue(_T("tichenren3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("tichenren4")) ) { pRSet->GetFieldValue(_T("tichenren4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("tichenren5")) ) { pRSet->GetFieldValue(_T("tichenren5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("send1")) ) { pRSet->GetFieldValue(_T("send1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("send2")) ) { pRSet->GetFieldValue(_T("send2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("send3")) ) { pRSet->GetFieldValue(_T("send3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("datetime4")) ) { pRSet->GetFieldValue(_T("datetime4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("datetime5")) ) { pRSet->GetFieldValue(_T("datetime5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("datetime6")) ) { pRSet->GetFieldValue(_T("datetime6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter12")) ) { pRSet->GetFieldValue(_T("waiter12"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter13")) ) { pRSet->GetFieldValue(_T("waiter13"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter14")) ) { pRSet->GetFieldValue(_T("waiter14"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter22")) ) { pRSet->GetFieldValue(_T("waiter22"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter23")) ) { pRSet->GetFieldValue(_T("waiter23"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter24")) ) { pRSet->GetFieldValue(_T("waiter24"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter1rate")) ) { pRSet->GetFieldValue(_T("waiter1rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter12rate")) ) { pRSet->GetFieldValue(_T("waiter12rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter13rate")) ) { pRSet->GetFieldValue(_T("waiter13rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter14rate")) ) { pRSet->GetFieldValue(_T("waiter14rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter2rate")) ) { pRSet->GetFieldValue(_T("waiter2rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter22rate")) ) { pRSet->GetFieldValue(_T("waiter22rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter23rate")) ) { pRSet->GetFieldValue(_T("waiter23rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter24rate")) ) { pRSet->GetFieldValue(_T("waiter24rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("ren2")) ) { pRSet->GetFieldValue(_T("ren2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("renrate")) ) { pRSet->GetFieldValue(_T("renrate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("ren2rate")) ) { pRSet->GetFieldValue(_T("ren2rate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("txtype")) ) { pRSet->GetFieldValue(_T("txtype"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("delphotos")) ) { pRSet->GetFieldValue(_T("delphotos"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("delphotos2")) ) { pRSet->GetFieldValue(_T("delphotos2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("growthtxselname")) ) { pRSet->GetFieldValue(_T("growthtxselname"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("designno")) ) { pRSet->GetFieldValue(_T("designno"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("designreplaceno")) ) { pRSet->GetFieldValue(_T("designreplaceno"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("size")) ) { pRSet->GetFieldValue(_T("size"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("dindantype")) ) { pRSet->GetFieldValue(_T("dindantype"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("contractno1")) ) { pRSet->GetFieldValue(_T("contractno1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("contractno2")) ) { pRSet->GetFieldValue(_T("contractno2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("cfno")) ) { pRSet->GetFieldValue(_T("cfno"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("calldate")) ) { pRSet->GetFieldValue(_T("calldate"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("from")) ) { pRSet->GetFieldValue(_T("from"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("reason")) ) { pRSet->GetFieldValue(_T("reason"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time7")) ) { pRSet->GetFieldValue(_T("time7"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time8")) ) { pRSet->GetFieldValue(_T("time8"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time9")) ) { pRSet->GetFieldValue(_T("time9"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("time10")) ) { pRSet->GetFieldValue(_T("time10"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("authorize")) ) { pRSet->GetFieldValue(_T("authorize"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("discount2")) ) { pRSet->GetFieldValue(_T("discount2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("authorize2")) ) { pRSet->GetFieldValue(_T("authorize2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bz4")) ) { pRSet->GetFieldValue(_T("bz4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction1")) ) { pRSet->GetFieldValue(_T("satisfaction1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction2")) ) { pRSet->GetFieldValue(_T("satisfaction2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction3")) ) { pRSet->GetFieldValue(_T("satisfaction3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction4")) ) { pRSet->GetFieldValue(_T("satisfaction4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction5")) ) { pRSet->GetFieldValue(_T("satisfaction5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction6")) ) { pRSet->GetFieldValue(_T("satisfaction6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction7")) ) { pRSet->GetFieldValue(_T("satisfaction7"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("bz5")) ) { pRSet->GetFieldValue(_T("bz5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("send4")) ) { pRSet->GetFieldValue(_T("send4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("send5")) ) { pRSet->GetFieldValue(_T("send5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("waiter9")) ) { pRSet->GetFieldValue(_T("waiter9"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("curno")) ) { pRSet->GetFieldValue(_T("curno"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("xplrr")) ) { pRSet->GetFieldValue(_T("xplrr"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("xplrtime")) ) { pRSet->GetFieldValue(_T("xplrtime"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("satisfaction8")) ) { pRSet->GetFieldValue(_T("satisfaction8"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople1")) ) { pRSet->GetFieldValue(_T("VisitPeople1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople2")) ) { pRSet->GetFieldValue(_T("VisitPeople2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople3")) ) { pRSet->GetFieldValue(_T("VisitPeople3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople4")) ) { pRSet->GetFieldValue(_T("VisitPeople4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople5")) ) { pRSet->GetFieldValue(_T("VisitPeople5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople6")) ) { pRSet->GetFieldValue(_T("VisitPeople6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople7")) ) { pRSet->GetFieldValue(_T("VisitPeople7"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitPeople8")) ) { pRSet->GetFieldValue(_T("VisitPeople8"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime1")) ) { pRSet->GetFieldValue(_T("VisitTime1"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime2")) ) { pRSet->GetFieldValue(_T("VisitTime2"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime3")) ) { pRSet->GetFieldValue(_T("VisitTime3"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime4")) ) { pRSet->GetFieldValue(_T("VisitTime4"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime5")) ) { pRSet->GetFieldValue(_T("VisitTime5"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime6")) ) { pRSet->GetFieldValue(_T("VisitTime6"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime7")) ) { pRSet->GetFieldValue(_T("VisitTime7"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } if( !pRSet->IsFieldNull(_T("VisitTime8")) ) { pRSet->GetFieldValue(_T("VisitTime8"), vtFieldValue); TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue); vtRet.push_back(strFieldValue); } else { vtRet.push_back(_T("")); } pRSet->MoveNext(); } DeleteADORecordSet(pRSet); return nRecordCount; } int AdoImpl::GetTbl_dindan_Values(IN CONST TCHAR *pTableName, IN CONST TCHAR *pFilters, IN CONST TCHAR *pSql, INT &nFieldCount, OUT vector& vtRet) { TCHAR szSQL[1024] = _T(""); _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), pTableName, pFilters); int nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( FALSE == bResult ) { LeaveCriticalSection( &m_csAdo ); return -1; } CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull(_T("cot")) ) { pRSet->GetFieldValue(_T("cot"), nRecordCount); } else { nRecordCount = -1; }// end if( !pRSet->IsFieldNull(0) ) DeleteADORecordSet(pRSet); pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } bResult = OpenADORecordSet(pRSet, pSql); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } nFieldCount = pRSet->GetFieldCount(); for ( int i = 0; i < nRecordCount; i++) { Tbl_dindan tagVal; if( !pRSet->IsFieldNull(_T("id")) ) { pRSet->GetFieldValue(_T("id"), vtFieldValue); tagVal._id = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._id = _T(""); } if( !pRSet->IsFieldNull(_T("money1")) ) { pRSet->GetFieldValue(_T("money1"), vtFieldValue); tagVal._money1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._money1 = _T(""); } if( !pRSet->IsFieldNull(_T("money2")) ) { pRSet->GetFieldValue(_T("money2"), vtFieldValue); tagVal._money2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._money2 = _T(""); } if( !pRSet->IsFieldNull(_T("money3")) ) { pRSet->GetFieldValue(_T("money3"), vtFieldValue); tagVal._money3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._money3 = _T(""); } if( !pRSet->IsFieldNull(_T("name1")) ) { pRSet->GetFieldValue(_T("name1"), vtFieldValue); tagVal._name1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._name1 = _T(""); } if( !pRSet->IsFieldNull(_T("name2")) ) { pRSet->GetFieldValue(_T("name2"), vtFieldValue); tagVal._name2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._name2 = _T(""); } if( !pRSet->IsFieldNull(_T("taoxiid")) ) { pRSet->GetFieldValue(_T("taoxiid"), vtFieldValue); tagVal._taoxiid = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._taoxiid = _T(""); } if( !pRSet->IsFieldNull(_T("taoxiname")) ) { pRSet->GetFieldValue(_T("taoxiname"), vtFieldValue); tagVal._taoxiname = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._taoxiname = _T(""); } if( !pRSet->IsFieldNull(_T("taoxijiage")) ) { pRSet->GetFieldValue(_T("taoxijiage"), vtFieldValue); tagVal._taoxijiage = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._taoxijiage = _T(""); } if( !pRSet->IsFieldNull(_T("taoxizs")) ) { pRSet->GetFieldValue(_T("taoxizs"), vtFieldValue); tagVal._taoxizs = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._taoxizs = _T(""); } if( !pRSet->IsFieldNull(_T("time1")) ) { pRSet->GetFieldValue(_T("time1"), vtFieldValue); tagVal._time1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time1 = _T(""); } if( !pRSet->IsFieldNull(_T("time2")) ) { pRSet->GetFieldValue(_T("time2"), vtFieldValue); tagVal._time2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time2 = _T(""); } if( !pRSet->IsFieldNull(_T("time3")) ) { pRSet->GetFieldValue(_T("time3"), vtFieldValue); tagVal._time3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time3 = _T(""); } if( !pRSet->IsFieldNull(_T("bm")) ) { pRSet->GetFieldValue(_T("bm"), vtFieldValue); tagVal._bm = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bm = _T(""); } if( !pRSet->IsFieldNull(_T("ren")) ) { pRSet->GetFieldValue(_T("ren"), vtFieldValue); tagVal._ren = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._ren = _T(""); } if( !pRSet->IsFieldNull(_T("discount")) ) { pRSet->GetFieldValue(_T("discount"), vtFieldValue); tagVal._discount = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._discount = _T(""); } if( !pRSet->IsFieldNull(_T("payed1")) ) { pRSet->GetFieldValue(_T("payed1"), vtFieldValue); tagVal._payed1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed1 = _T(""); } if( !pRSet->IsFieldNull(_T("payed2")) ) { pRSet->GetFieldValue(_T("payed2"), vtFieldValue); tagVal._payed2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed2 = _T(""); } if( !pRSet->IsFieldNull(_T("payed3")) ) { pRSet->GetFieldValue(_T("payed3"), vtFieldValue); tagVal._payed3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed3 = _T(""); } if( !pRSet->IsFieldNull(_T("payed4")) ) { pRSet->GetFieldValue(_T("payed4"), vtFieldValue); tagVal._payed4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed4 = _T(""); } if( !pRSet->IsFieldNull(_T("payed5")) ) { pRSet->GetFieldValue(_T("payed5"), vtFieldValue); tagVal._payed5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed5 = _T(""); } if( !pRSet->IsFieldNull(_T("time4")) ) { pRSet->GetFieldValue(_T("time4"), vtFieldValue); tagVal._time4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time4 = _T(""); } if( !pRSet->IsFieldNull(_T("time5")) ) { pRSet->GetFieldValue(_T("time5"), vtFieldValue); tagVal._time5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time5 = _T(""); } if( !pRSet->IsFieldNull(_T("takezs")) ) { pRSet->GetFieldValue(_T("takezs"), vtFieldValue); tagVal._takezs = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._takezs = _T(""); } if( !pRSet->IsFieldNull(_T("choosezs")) ) { pRSet->GetFieldValue(_T("choosezs"), vtFieldValue); tagVal._choosezs = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._choosezs = _T(""); } if( !pRSet->IsFieldNull(_T("status")) ) { pRSet->GetFieldValue(_T("status"), vtFieldValue); tagVal._status = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status = _T(""); } if( !pRSet->IsFieldNull(_T("clothescount2")) ) { pRSet->GetFieldValue(_T("clothescount2"), vtFieldValue); tagVal._clothescount2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._clothescount2 = _T(""); } if( !pRSet->IsFieldNull(_T("outside2")) ) { pRSet->GetFieldValue(_T("outside2"), vtFieldValue); tagVal._outside2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._outside2 = _T(""); } if( !pRSet->IsFieldNull(_T("style")) ) { pRSet->GetFieldValue(_T("style"), vtFieldValue); tagVal._style = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._style = _T(""); } if( !pRSet->IsFieldNull(_T("payed3time")) ) { pRSet->GetFieldValue(_T("payed3time"), vtFieldValue); tagVal._payed3time = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed3time = _T(""); } if( !pRSet->IsFieldNull(_T("payed4ren")) ) { pRSet->GetFieldValue(_T("payed4ren"), vtFieldValue); tagVal._payed4ren = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed4ren = _T(""); } if( !pRSet->IsFieldNull(_T("payed4time")) ) { pRSet->GetFieldValue(_T("payed4time"), vtFieldValue); tagVal._payed4time = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._payed4time = _T(""); } if( !pRSet->IsFieldNull(_T("status2")) ) { pRSet->GetFieldValue(_T("status2"), vtFieldValue); tagVal._status2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status2 = _T(""); } if( !pRSet->IsFieldNull(_T("status3")) ) { pRSet->GetFieldValue(_T("status3"), vtFieldValue); tagVal._status3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status3 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter1")) ) { pRSet->GetFieldValue(_T("waiter1"), vtFieldValue); tagVal._waiter1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter1 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter2")) ) { pRSet->GetFieldValue(_T("waiter2"), vtFieldValue); tagVal._waiter2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter2 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter3")) ) { pRSet->GetFieldValue(_T("waiter3"), vtFieldValue); tagVal._waiter3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter3 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter4")) ) { pRSet->GetFieldValue(_T("waiter4"), vtFieldValue); tagVal._waiter4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter4 = _T(""); } if( !pRSet->IsFieldNull(_T("bz")) ) { pRSet->GetFieldValue(_T("bz"), vtFieldValue); tagVal._bz = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bz = _T(""); } if( !pRSet->IsFieldNull(_T("taketime")) ) { pRSet->GetFieldValue(_T("taketime"), vtFieldValue); tagVal._taketime = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._taketime = _T(""); } if( !pRSet->IsFieldNull(_T("clothescount")) ) { pRSet->GetFieldValue(_T("clothescount"), vtFieldValue); tagVal._clothescount = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._clothescount = _T(""); } if( !pRSet->IsFieldNull(_T("outside")) ) { pRSet->GetFieldValue(_T("outside"), vtFieldValue); tagVal._outside = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._outside = _T(""); } if( !pRSet->IsFieldNull(_T("bz2")) ) { pRSet->GetFieldValue(_T("bz2"), vtFieldValue); tagVal._bz2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bz2 = _T(""); } if( !pRSet->IsFieldNull(_T("bz3")) ) { pRSet->GetFieldValue(_T("bz3"), vtFieldValue); tagVal._bz3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bz3 = _T(""); } if( !pRSet->IsFieldNull(_T("urgent")) ) { pRSet->GetFieldValue(_T("urgent"), vtFieldValue); tagVal._urgent = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._urgent = _T(""); } if( !pRSet->IsFieldNull(_T("status4")) ) { pRSet->GetFieldValue(_T("status4"), vtFieldValue); tagVal._status4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status4 = _T(""); } if( !pRSet->IsFieldNull(_T("status5")) ) { pRSet->GetFieldValue(_T("status5"), vtFieldValue); tagVal._status5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status5 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter5")) ) { pRSet->GetFieldValue(_T("waiter5"), vtFieldValue); tagVal._waiter5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter5 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter6")) ) { pRSet->GetFieldValue(_T("waiter6"), vtFieldValue); tagVal._waiter6 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter6 = _T(""); } if( !pRSet->IsFieldNull(_T("pinyin1")) ) { pRSet->GetFieldValue(_T("pinyin1"), vtFieldValue); tagVal._pinyin1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._pinyin1 = _T(""); } if( !pRSet->IsFieldNull(_T("pinyin2")) ) { pRSet->GetFieldValue(_T("pinyin2"), vtFieldValue); tagVal._pinyin2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._pinyin2 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter7")) ) { pRSet->GetFieldValue(_T("waiter7"), vtFieldValue); tagVal._waiter7 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter7 = _T(""); } if( !pRSet->IsFieldNull(_T("status6")) ) { pRSet->GetFieldValue(_T("status6"), vtFieldValue); tagVal._status6 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status6 = _T(""); } if( !pRSet->IsFieldNull(_T("phone1")) ) { pRSet->GetFieldValue(_T("phone1"), vtFieldValue); tagVal._phone1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._phone1 = _T(""); } if( !pRSet->IsFieldNull(_T("phone2")) ) { pRSet->GetFieldValue(_T("phone2"), vtFieldValue); tagVal._phone2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._phone2 = _T(""); } if( !pRSet->IsFieldNull(_T("status7")) ) { pRSet->GetFieldValue(_T("status7"), vtFieldValue); tagVal._status7 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status7 = _T(""); } if( !pRSet->IsFieldNull(_T("memberno")) ) { pRSet->GetFieldValue(_T("memberno"), vtFieldValue); tagVal._memberno = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._memberno = _T(""); } if( !pRSet->IsFieldNull(_T("waiter8")) ) { pRSet->GetFieldValue(_T("waiter8"), vtFieldValue); tagVal._waiter8 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter8 = _T(""); } if( !pRSet->IsFieldNull(_T("time6")) ) { pRSet->GetFieldValue(_T("time6"), vtFieldValue); tagVal._time6 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time6 = _T(""); } if( !pRSet->IsFieldNull(_T("status8")) ) { pRSet->GetFieldValue(_T("status8"), vtFieldValue); tagVal._status8 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._status8 = _T(""); } if( !pRSet->IsFieldNull(_T("bruncount")) ) { pRSet->GetFieldValue(_T("bruncount"), vtFieldValue); tagVal._bruncount = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bruncount = _T(""); } if( !pRSet->IsFieldNull(_T("tichenren1")) ) { pRSet->GetFieldValue(_T("tichenren1"), vtFieldValue); tagVal._tichenren1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._tichenren1 = _T(""); } if( !pRSet->IsFieldNull(_T("tichenren2")) ) { pRSet->GetFieldValue(_T("tichenren2"), vtFieldValue); tagVal._tichenren2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._tichenren2 = _T(""); } if( !pRSet->IsFieldNull(_T("tichenren3")) ) { pRSet->GetFieldValue(_T("tichenren3"), vtFieldValue); tagVal._tichenren3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._tichenren3 = _T(""); } if( !pRSet->IsFieldNull(_T("tichenren4")) ) { pRSet->GetFieldValue(_T("tichenren4"), vtFieldValue); tagVal._tichenren4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._tichenren4 = _T(""); } if( !pRSet->IsFieldNull(_T("tichenren5")) ) { pRSet->GetFieldValue(_T("tichenren5"), vtFieldValue); tagVal._tichenren5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._tichenren5 = _T(""); } if( !pRSet->IsFieldNull(_T("send1")) ) { pRSet->GetFieldValue(_T("send1"), vtFieldValue); tagVal._send1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._send1 = _T(""); } if( !pRSet->IsFieldNull(_T("send2")) ) { pRSet->GetFieldValue(_T("send2"), vtFieldValue); tagVal._send2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._send2 = _T(""); } if( !pRSet->IsFieldNull(_T("send3")) ) { pRSet->GetFieldValue(_T("send3"), vtFieldValue); tagVal._send3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._send3 = _T(""); } if( !pRSet->IsFieldNull(_T("datetime4")) ) { pRSet->GetFieldValue(_T("datetime4"), vtFieldValue); tagVal._datetime4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._datetime4 = _T(""); } if( !pRSet->IsFieldNull(_T("datetime5")) ) { pRSet->GetFieldValue(_T("datetime5"), vtFieldValue); tagVal._datetime5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._datetime5 = _T(""); } if( !pRSet->IsFieldNull(_T("datetime6")) ) { pRSet->GetFieldValue(_T("datetime6"), vtFieldValue); tagVal._datetime6 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._datetime6 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter12")) ) { pRSet->GetFieldValue(_T("waiter12"), vtFieldValue); tagVal._waiter12 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter12 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter13")) ) { pRSet->GetFieldValue(_T("waiter13"), vtFieldValue); tagVal._waiter13 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter13 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter14")) ) { pRSet->GetFieldValue(_T("waiter14"), vtFieldValue); tagVal._waiter14 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter14 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter22")) ) { pRSet->GetFieldValue(_T("waiter22"), vtFieldValue); tagVal._waiter22 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter22 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter23")) ) { pRSet->GetFieldValue(_T("waiter23"), vtFieldValue); tagVal._waiter23 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter23 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter24")) ) { pRSet->GetFieldValue(_T("waiter24"), vtFieldValue); tagVal._waiter24 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter24 = _T(""); } if( !pRSet->IsFieldNull(_T("waiter1rate")) ) { pRSet->GetFieldValue(_T("waiter1rate"), vtFieldValue); tagVal._waiter1rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter1rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter12rate")) ) { pRSet->GetFieldValue(_T("waiter12rate"), vtFieldValue); tagVal._waiter12rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter12rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter13rate")) ) { pRSet->GetFieldValue(_T("waiter13rate"), vtFieldValue); tagVal._waiter13rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter13rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter14rate")) ) { pRSet->GetFieldValue(_T("waiter14rate"), vtFieldValue); tagVal._waiter14rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter14rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter2rate")) ) { pRSet->GetFieldValue(_T("waiter2rate"), vtFieldValue); tagVal._waiter2rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter2rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter22rate")) ) { pRSet->GetFieldValue(_T("waiter22rate"), vtFieldValue); tagVal._waiter22rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter22rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter23rate")) ) { pRSet->GetFieldValue(_T("waiter23rate"), vtFieldValue); tagVal._waiter23rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter23rate = _T(""); } if( !pRSet->IsFieldNull(_T("waiter24rate")) ) { pRSet->GetFieldValue(_T("waiter24rate"), vtFieldValue); tagVal._waiter24rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter24rate = _T(""); } if( !pRSet->IsFieldNull(_T("ren2")) ) { pRSet->GetFieldValue(_T("ren2"), vtFieldValue); tagVal._ren2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._ren2 = _T(""); } if( !pRSet->IsFieldNull(_T("renrate")) ) { pRSet->GetFieldValue(_T("renrate"), vtFieldValue); tagVal._renrate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._renrate = _T(""); } if( !pRSet->IsFieldNull(_T("ren2rate")) ) { pRSet->GetFieldValue(_T("ren2rate"), vtFieldValue); tagVal._ren2rate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._ren2rate = _T(""); } if( !pRSet->IsFieldNull(_T("txtype")) ) { pRSet->GetFieldValue(_T("txtype"), vtFieldValue); tagVal._txtype = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._txtype = _T(""); } if( !pRSet->IsFieldNull(_T("delphotos")) ) { pRSet->GetFieldValue(_T("delphotos"), vtFieldValue); tagVal._delphotos = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._delphotos = _T(""); } if( !pRSet->IsFieldNull(_T("delphotos2")) ) { pRSet->GetFieldValue(_T("delphotos2"), vtFieldValue); tagVal._delphotos2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._delphotos2 = _T(""); } if( !pRSet->IsFieldNull(_T("growthtxselname")) ) { pRSet->GetFieldValue(_T("growthtxselname"), vtFieldValue); tagVal._growthtxselname = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._growthtxselname = _T(""); } if( !pRSet->IsFieldNull(_T("designno")) ) { pRSet->GetFieldValue(_T("designno"), vtFieldValue); tagVal._designno = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._designno = _T(""); } if( !pRSet->IsFieldNull(_T("designreplaceno")) ) { pRSet->GetFieldValue(_T("designreplaceno"), vtFieldValue); tagVal._designreplaceno = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._designreplaceno = _T(""); } if( !pRSet->IsFieldNull(_T("size")) ) { pRSet->GetFieldValue(_T("size"), vtFieldValue); tagVal._size = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._size = _T(""); } if( !pRSet->IsFieldNull(_T("dindantype")) ) { pRSet->GetFieldValue(_T("dindantype"), vtFieldValue); tagVal._dindantype = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._dindantype = _T(""); } if( !pRSet->IsFieldNull(_T("contractno1")) ) { pRSet->GetFieldValue(_T("contractno1"), vtFieldValue); tagVal._contractno1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._contractno1 = _T(""); } if( !pRSet->IsFieldNull(_T("contractno2")) ) { pRSet->GetFieldValue(_T("contractno2"), vtFieldValue); tagVal._contractno2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._contractno2 = _T(""); } if( !pRSet->IsFieldNull(_T("cfno")) ) { pRSet->GetFieldValue(_T("cfno"), vtFieldValue); tagVal._cfno = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._cfno = _T(""); } if( !pRSet->IsFieldNull(_T("calldate")) ) { pRSet->GetFieldValue(_T("calldate"), vtFieldValue); tagVal._calldate = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._calldate = _T(""); } if( !pRSet->IsFieldNull(_T("from")) ) { pRSet->GetFieldValue(_T("from"), vtFieldValue); tagVal._from = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._from = _T(""); } if( !pRSet->IsFieldNull(_T("reason")) ) { pRSet->GetFieldValue(_T("reason"), vtFieldValue); tagVal._reason = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._reason = _T(""); } if( !pRSet->IsFieldNull(_T("time7")) ) { pRSet->GetFieldValue(_T("time7"), vtFieldValue); tagVal._time7 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time7 = _T(""); } if( !pRSet->IsFieldNull(_T("time8")) ) { pRSet->GetFieldValue(_T("time8"), vtFieldValue); tagVal._time8 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time8 = _T(""); } if( !pRSet->IsFieldNull(_T("time9")) ) { pRSet->GetFieldValue(_T("time9"), vtFieldValue); tagVal._time9 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time9 = _T(""); } if( !pRSet->IsFieldNull(_T("time10")) ) { pRSet->GetFieldValue(_T("time10"), vtFieldValue); tagVal._time10 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._time10 = _T(""); } if( !pRSet->IsFieldNull(_T("authorize")) ) { pRSet->GetFieldValue(_T("authorize"), vtFieldValue); tagVal._authorize = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._authorize = _T(""); } if( !pRSet->IsFieldNull(_T("discount2")) ) { pRSet->GetFieldValue(_T("discount2"), vtFieldValue); tagVal._discount2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._discount2 = _T(""); } if( !pRSet->IsFieldNull(_T("authorize2")) ) { pRSet->GetFieldValue(_T("authorize2"), vtFieldValue); tagVal._authorize2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._authorize2 = _T(""); } if( !pRSet->IsFieldNull(_T("bz4")) ) { pRSet->GetFieldValue(_T("bz4"), vtFieldValue); tagVal._bz4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bz4 = _T(""); } if( !pRSet->IsFieldNull(_T("satisfaction1")) ) { pRSet->GetFieldValue(_T("satisfaction1"), vtFieldValue); tagVal._satisfaction1 = vtFieldValue; } else { tagVal._satisfaction1 = 0; } if( !pRSet->IsFieldNull(_T("satisfaction2")) ) { pRSet->GetFieldValue(_T("satisfaction2"), vtFieldValue); tagVal._satisfaction2 = vtFieldValue; } else { tagVal._satisfaction2 = 0; } if( !pRSet->IsFieldNull(_T("satisfaction3")) ) { pRSet->GetFieldValue(_T("satisfaction3"), vtFieldValue); tagVal._satisfaction3 = vtFieldValue; } else { tagVal._satisfaction3 = 0; } if( !pRSet->IsFieldNull(_T("satisfaction4")) ) { pRSet->GetFieldValue(_T("satisfaction4"), vtFieldValue); tagVal._satisfaction4 = vtFieldValue; } else { tagVal._satisfaction4 = 0; } if( !pRSet->IsFieldNull(_T("satisfaction5")) ) { pRSet->GetFieldValue(_T("satisfaction5"), vtFieldValue); tagVal._satisfaction5 = vtFieldValue; } else { tagVal._satisfaction5 = 0; } if( !pRSet->IsFieldNull(_T("satisfaction6")) ) { pRSet->GetFieldValue(_T("satisfaction6"), vtFieldValue); tagVal._satisfaction6 = vtFieldValue; } else { tagVal._satisfaction6 = 0; } if( !pRSet->IsFieldNull(_T("satisfaction7")) ) { pRSet->GetFieldValue(_T("satisfaction7"), vtFieldValue); tagVal._satisfaction7 = vtFieldValue; } else { tagVal._satisfaction7 = 0; } if( !pRSet->IsFieldNull(_T("bz5")) ) { pRSet->GetFieldValue(_T("bz5"), vtFieldValue); tagVal._bz5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._bz5 = _T(""); } if( !pRSet->IsFieldNull(_T("send4")) ) { pRSet->GetFieldValue(_T("send4"), vtFieldValue); tagVal._send4 = vtFieldValue; } else { tagVal._send4 = 0; } if( !pRSet->IsFieldNull(_T("send5")) ) { pRSet->GetFieldValue(_T("send5"), vtFieldValue); tagVal._send5 = vtFieldValue; } else { tagVal._send5 = 0; } if( !pRSet->IsFieldNull(_T("waiter9")) ) { pRSet->GetFieldValue(_T("waiter9"), vtFieldValue); tagVal._waiter9 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._waiter9 = _T(""); } if( !pRSet->IsFieldNull(_T("curno")) ) { pRSet->GetFieldValue(_T("curno"), vtFieldValue); tagVal._curno = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._curno = _T(""); } if( !pRSet->IsFieldNull(_T("xplrr")) ) { pRSet->GetFieldValue(_T("xplrr"), vtFieldValue); tagVal._xplrr = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._xplrr = _T(""); } if( !pRSet->IsFieldNull(_T("xplrtime")) ) { pRSet->GetFieldValue(_T("xplrtime"), vtFieldValue); tagVal._xplrtime = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._xplrtime = _T(""); } if( !pRSet->IsFieldNull(_T("satisfaction8")) ) { pRSet->GetFieldValue(_T("satisfaction8"), vtFieldValue); tagVal._satisfaction8 = vtFieldValue; } else { tagVal._satisfaction8 = 0; } if( !pRSet->IsFieldNull(_T("VisitPeople1")) ) { pRSet->GetFieldValue(_T("VisitPeople1"), vtFieldValue); tagVal._visitpeople1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople1 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople2")) ) { pRSet->GetFieldValue(_T("VisitPeople2"), vtFieldValue); tagVal._visitpeople2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople2 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople3")) ) { pRSet->GetFieldValue(_T("VisitPeople3"), vtFieldValue); tagVal._visitpeople3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople3 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople4")) ) { pRSet->GetFieldValue(_T("VisitPeople4"), vtFieldValue); tagVal._visitpeople4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople4 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople5")) ) { pRSet->GetFieldValue(_T("VisitPeople5"), vtFieldValue); tagVal._visitpeople5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople5 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople6")) ) { pRSet->GetFieldValue(_T("VisitPeople6"), vtFieldValue); tagVal._visitpeople6 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople6 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople7")) ) { pRSet->GetFieldValue(_T("VisitPeople7"), vtFieldValue); tagVal._visitpeople7 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople7 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitPeople8")) ) { pRSet->GetFieldValue(_T("VisitPeople8"), vtFieldValue); tagVal._visitpeople8 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visitpeople8 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime1")) ) { pRSet->GetFieldValue(_T("VisitTime1"), vtFieldValue); tagVal._visittime1 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime1 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime2")) ) { pRSet->GetFieldValue(_T("VisitTime2"), vtFieldValue); tagVal._visittime2 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime2 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime3")) ) { pRSet->GetFieldValue(_T("VisitTime3"), vtFieldValue); tagVal._visittime3 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime3 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime4")) ) { pRSet->GetFieldValue(_T("VisitTime4"), vtFieldValue); tagVal._visittime4 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime4 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime5")) ) { pRSet->GetFieldValue(_T("VisitTime5"), vtFieldValue); tagVal._visittime5 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime5 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime6")) ) { pRSet->GetFieldValue(_T("VisitTime6"), vtFieldValue); tagVal._visittime6 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime6 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime7")) ) { pRSet->GetFieldValue(_T("VisitTime7"), vtFieldValue); tagVal._visittime7 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime7 = _T(""); } if( !pRSet->IsFieldNull(_T("VisitTime8")) ) { pRSet->GetFieldValue(_T("VisitTime8"), vtFieldValue); tagVal._visittime8 = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._visittime8 = _T(""); } vtRet.push_back(tagVal); pRSet->MoveNext(); } DeleteADORecordSet(pRSet); return nRecordCount; } int AdoImpl::GetTbl_IncrementalBackup_Values(IN CONST TCHAR *pTableName, IN CONST TCHAR *pFilters, IN CONST TCHAR *pSql, INT &nFieldCount, OUT vector& vtRet) { TCHAR szSQL[1024] = _T(""); if(pFilters == NULL || _tcscmp(pFilters,_T("")) == 0) _stprintf_s(szSQL,_T("select count(*) as cot from %s"),pTableName); else _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), pTableName, pFilters); int nRecordCount = 0; _variant_t vtFieldValue; BOOL bResult = FALSE; EnterCriticalSection( &m_csAdo ); bResult = GetADODateBaseStatus(); if( FALSE == bResult ) { LeaveCriticalSection( &m_csAdo ); return -1; } CADORecordset* pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } bResult = OpenADORecordSet(pRSet, szSQL); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } if( !pRSet->IsFieldNull(_T("cot")) ) { pRSet->GetFieldValue(_T("cot"), nRecordCount); } else { nRecordCount = -1; }// end if( !pRSet->IsFieldNull(0) ) DeleteADORecordSet(pRSet); pRSet = new CADORecordset(m_pADODatabase); LeaveCriticalSection( &m_csAdo ); if( NULL == pRSet ) { return -1; } bResult = OpenADORecordSet(pRSet, pSql); if( FALSE == bResult ) { DeleteADORecordSet(pRSet); return -1; } nFieldCount = pRSet->GetFieldCount(); for ( int i = 0; i < nRecordCount; i++) { Tbl_IncrementalBackup tagVal; if( !pRSet->IsFieldNull(_T("isbackup")) ) { pRSet->GetFieldValue(_T("isbackup"), vtFieldValue); tagVal._isbackup = vtFieldValue; } else { tagVal._isbackup = false; } if( !pRSet->IsFieldNull(_T("branchid")) ) { pRSet->GetFieldValue(_T("branchid"), vtFieldValue); tagVal._branchid = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._branchid = _T(""); } if( !pRSet->IsFieldNull(_T("opttime")) ) { pRSet->GetFieldValue(_T("opttime"), vtFieldValue); tagVal._opttime = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._opttime = _T(""); } if( !pRSet->IsFieldNull(_T("order")) ) { pRSet->GetFieldValue(_T("order"), vtFieldValue); tagVal._order = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._order = _T(""); } if( !pRSet->IsFieldNull(_T("photoType")) ) { pRSet->GetFieldValue(_T("photoType"), vtFieldValue); tagVal._phototype = vtFieldValue; } else { tagVal._phototype = 0; } if( !pRSet->IsFieldNull(_T("content")) ) { pRSet->GetFieldValue(_T("content"), vtFieldValue); tagVal._content = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._content = _T(""); } if( !pRSet->IsFieldNull(_T("userid")) ) { pRSet->GetFieldValue(_T("userid"), vtFieldValue); tagVal._userid = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._userid = _T(""); } if( !pRSet->IsFieldNull(_T("username")) ) { pRSet->GetFieldValue(_T("username"), vtFieldValue); tagVal._username = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._username = _T(""); } if( !pRSet->IsFieldNull(_T("baktime")) ) { pRSet->GetFieldValue(_T("baktime"), vtFieldValue); tagVal._baktime = TString((TCHAR*)(_bstr_t)vtFieldValue); } else { tagVal._baktime = _T(""); } vtRet.push_back(tagVal); pRSet->MoveNext(); } DeleteADORecordSet(pRSet); return nRecordCount; }