AdoImpl_2.cpp 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974
  1. #include "StdAfx.h"
  2. #include "AdoImpl_2.h"
  3. AdoImpl::AdoImpl(void)
  4. {
  5. m_pADODatabase = NULL;
  6. memset(m_szConnectString, 0, 1024);
  7. InitializeCriticalSection(&m_csAdo);
  8. }
  9. AdoImpl::~AdoImpl(void)
  10. {
  11. DeleteCriticalSection(&m_csAdo);
  12. }
  13. void AdoImpl::SetConnectString(
  14. IN const int &nType,
  15. IN LPCTSTR lpDataSource,
  16. IN LPCTSTR lpDatabaseTCPPort,
  17. IN LPCTSTR lpDatabaseAccount,
  18. IN LPCTSTR lpDatabasePassWord,
  19. IN LPCTSTR lpDatabaseName,
  20. IN LPCTSTR lpDatabaseFile)
  21. {
  22. switch (nType)
  23. {
  24. case ADO_ACCESS97:
  25. _stprintf_s(m_szConnectString, _T("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=%s"), lpDatabaseFile);
  26. break;
  27. case ADO_ACCESS2000:
  28. _stprintf_s(m_szConnectString, _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s"), lpDatabaseFile);
  29. break;
  30. case ADO_ACCESS2007:
  31. _stprintf_s(m_szConnectString, _T("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%s"), lpDatabaseFile);
  32. break;
  33. case ADO_SQLSERVER:
  34. {
  35. if ( !_tcsicmp(lpDatabaseTCPPort, _T("0")))
  36. {
  37. //sprintf(m_szConnectString, "Provider=sqloledb.1;Persist Security Info=false;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; ",
  38. _stprintf_s(m_szConnectString, _T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; "),
  39. lpDataSource, // IP地址或服务名称;
  40. lpDatabaseName,
  41. lpDatabaseAccount,
  42. lpDatabasePassWord);
  43. }
  44. else
  45. {
  46. //sprintf(m_szConnectString, "Provider=sqloledb.1;Persist Security Info=false;Data Source=%s,%s;Initial Catalog=%s;User Id=%s;Password=%s; ",
  47. _stprintf_s(m_szConnectString, _T("Provider=sqloledb;Data Source=%s,%s;Initial Catalog=%s;User Id=%s;Password=%s; "),
  48. lpDataSource, // IP地址或服务名称;
  49. lpDatabaseTCPPort,
  50. lpDatabaseName,
  51. lpDatabaseAccount,
  52. lpDatabasePassWord);
  53. }
  54. }
  55. break;
  56. case ADO_PGSQL:
  57. {
  58. _stprintf_s(m_szConnectString, _T("DRIVER={PostgreSQL ODBC Driver(UNICODE)}; SERVER=%s; port=%s; DATABASE=%s; UID=%s; PWD=%s;"),
  59. lpDataSource, // IP地址或服务名称;
  60. lpDatabaseTCPPort,
  61. lpDatabaseName,
  62. lpDatabaseAccount,
  63. lpDatabasePassWord);
  64. }
  65. break;
  66. default:
  67. break;
  68. }
  69. }
  70. BOOL AdoImpl::IsOpen()
  71. {
  72. if ( m_pADODatabase == NULL)
  73. return FALSE;
  74. return m_pADODatabase->IsOpen();
  75. }
  76. BOOL AdoImpl::Opendatabase(IN LPCTSTR lpConnectString /* = NULL */)
  77. {
  78. BOOL bResult = FALSE;
  79. if( NULL == m_pADODatabase )
  80. {
  81. m_pADODatabase = new CADODatabase();
  82. if( m_pADODatabase )
  83. {
  84. if( lpConnectString == NULL )
  85. {
  86. m_pADODatabase->SetConnectionString(m_szConnectString);
  87. }
  88. else
  89. {
  90. m_pADODatabase->SetConnectionString(lpConnectString);
  91. _tcscpy_s(m_szConnectString, lpConnectString);
  92. }
  93. if( TRUE == m_pADODatabase->Open() )
  94. {
  95. //LOG4C((LOG_NOTICE, "Database Connetion Success!"));
  96. bResult = TRUE;
  97. }
  98. else
  99. {
  100. if( m_pADODatabase->IsOpen() )
  101. {
  102. m_pADODatabase->Close();
  103. }
  104. delete m_pADODatabase;
  105. m_pADODatabase = NULL;
  106. //LOG4C((LOG_NOTICE, "Database Connetion Lost!"));
  107. }
  108. }
  109. }
  110. return bResult;
  111. }
  112. void AdoImpl::Closedatabase()
  113. {
  114. if( NULL != m_pADODatabase )
  115. {
  116. if( m_pADODatabase->IsOpen() )
  117. {
  118. m_pADODatabase->Close();
  119. }
  120. if( m_pADODatabase )
  121. delete m_pADODatabase;
  122. m_pADODatabase = NULL;
  123. }
  124. }
  125. void AdoImpl::dump_com_error(_com_error &e)
  126. {
  127. CString ErrorStr;
  128. _bstr_t bstrSource(e.Source());
  129. _bstr_t bstrDescription(e.Description());
  130. ErrorStr.Format(_T("CADORecordset Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n"),
  131. e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription );
  132. m_strLastError = _T("Query = " + GetQuery() + '\n' + ErrorStr);
  133. m_dwLastError = e.Error();
  134. #ifdef _DEBUG
  135. AfxMessageBox( ErrorStr, MB_OK | MB_ICONERROR );
  136. #endif
  137. }
  138. int AdoImpl::Execute(IN LPCTSTR lpSQL)
  139. {
  140. INT iRetCode = 0;
  141. if( NULL == m_pADODatabase )
  142. {
  143. //LOG4C((LOG_NOTICE, "NULL == m_pADODatabase" ));
  144. return -1;
  145. }
  146. try
  147. {
  148. EnterCriticalSection(&m_csAdo);
  149. if ( m_pADODatabase->IsOpen() )
  150. {
  151. iRetCode = m_pADODatabase->Execute(lpSQL);
  152. LeaveCriticalSection(&m_csAdo);
  153. }
  154. else
  155. {
  156. LeaveCriticalSection(&m_csAdo);
  157. //LOG4C((LOG_NOTICE, "m_pADODatabase->IsOpen() = false" ));
  158. return -1;
  159. }
  160. }
  161. catch (_com_error &e)
  162. {
  163. dump_com_error(e);
  164. //LOG4C( ( LOG_ERROR, "Execute SQL Script Error, Script:%s, ErrorMsg:%s", pSql, e.ErrorMessage() ) );
  165. }// end catch (_com_error &e)
  166. return iRetCode;
  167. }
  168. void AdoImpl::DeleteADORecordSet(CADORecordset* pRSet)
  169. {
  170. CloseADORecordSet(pRSet);
  171. if( pRSet )
  172. {
  173. delete pRSet;
  174. pRSet = NULL;
  175. }
  176. }
  177. BOOL AdoImpl::OpenADORecordSet(IN CADORecordset *pRSet, IN LPCTSTR lpSQL)
  178. {
  179. int iRetCode;
  180. BOOL bResult = TRUE;
  181. if( NULL == pRSet ) return false;
  182. try
  183. {
  184. iRetCode = pRSet->Open(lpSQL, CADORecordset::openQuery);
  185. if (iRetCode == 0)
  186. {
  187. DeleteADORecordSet(pRSet);
  188. bResult = FALSE;
  189. }
  190. }
  191. catch (_com_error &e)
  192. {
  193. dump_com_error(e);
  194. //LOG4C( ( LOG_ERROR, "Execute SQL Script Error, Script:%s, ErrorMsg:%s", pSql, e.ErrorMessage() ) );
  195. DeleteADORecordSet(pRSet);
  196. bResult = FALSE;
  197. }// end catch (_com_error &e)
  198. return bResult;
  199. }
  200. void AdoImpl::CloseADORecordSet(CADORecordset* pRSet)
  201. {
  202. if( NULL != pRSet )
  203. {
  204. if( pRSet->IsOpen() )
  205. {
  206. pRSet->Close();
  207. }
  208. }
  209. }
  210. bool AdoImpl::GetADODateBaseStatus()
  211. {
  212. if( NULL == m_pADODatabase || !m_pADODatabase->IsOpen())
  213. return false;
  214. return true;
  215. }
  216. DWORD AdoImpl::GetTableRecordCount(IN LPCTSTR lpTableName, IN LPCTSTR lpFilters)
  217. {
  218. if ( lpTableName == NULL)
  219. return -1;
  220. TCHAR szSQL[1024] = _T("");
  221. if(lpFilters == NULL || _tcscmp(lpFilters,_T("")) == 0)
  222. _stprintf_s(szSQL,_T("select count(*) as cot from %s"),lpTableName);
  223. else
  224. _stprintf_s(szSQL,_T("select count(*) as cot from %s where %s"),lpTableName,lpFilters);
  225. DWORD nRecordCount = 0;
  226. _variant_t vtFieldValue;
  227. BOOL bResult = FALSE;
  228. //AutoThreadSection aSection(&s_critSection);
  229. EnterCriticalSection(&m_csAdo);
  230. bResult = GetADODateBaseStatus();
  231. if( FALSE == bResult )
  232. {
  233. LeaveCriticalSection(&m_csAdo);
  234. return -1;
  235. }
  236. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  237. if( NULL == pRSet )
  238. {
  239. LeaveCriticalSection(&m_csAdo);
  240. //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL"));
  241. return -1;
  242. }
  243. bResult = OpenADORecordSet(pRSet, szSQL);
  244. if( FALSE == bResult )
  245. {
  246. LeaveCriticalSection(&m_csAdo);
  247. //LOG4C((LOG_NOTICE, "GetFieldValueList1 OpenADORecordSet <%s>", pSql));
  248. DeleteADORecordSet(pRSet);
  249. return -1;
  250. }
  251. if( !pRSet->IsFieldNull(_T("cot")) )
  252. {
  253. pRSet->GetFieldValue(_T("cot"), nRecordCount);
  254. }
  255. else
  256. {
  257. nRecordCount = -1;
  258. }// end if( !pRSet->IsFieldNull(0) )
  259. DeleteADORecordSet(pRSet);
  260. LeaveCriticalSection(&m_csAdo);
  261. return nRecordCount;
  262. }
  263. /************************************************************************/
  264. /* 函数:GetFieldValueList[4/12/2016 IT];
  265. /* 描述:获取指定表查询字段的条件记录集;
  266. /* 参数:;
  267. /* [IN] lpTableName:要查询的表;
  268. /* [IN] lpFields:要查询的字段;
  269. /* [IN] lpFilters:查询的条件;
  270. /* [IN] dwCallBackType:回调函数类型;
  271. /* [IN] lpCallBack:回调函数指针;
  272. /* [INOUT] lpParamter:传递给回调函数的参数;
  273. /* 返回:成功查询返回记录数, 参数错误返回-1;
  274. /* 注意:;
  275. /* 示例:;
  276. /*
  277. /* 修改:;
  278. /* 日期:;
  279. /* 内容:;
  280. /************************************************************************/
  281. int AdoImpl::GetFieldValueList(IN LPCTSTR lpTableName, IN LPCTSTR lpFields, IN LPCTSTR lpFilters, IN const DWORD &dwCallBackType, IN LPVOID lpCallBack, IN OUT LPVOID lpParamter)
  282. {
  283. if ( lpCallBack == NULL || lpParamter == NULL )
  284. return -1;
  285. if ( lpTableName == NULL || lpTableName[0] == _T('\0') || lpFields == NULL || lpFields[0] == _T('\0'))
  286. return -1;
  287. int nRecordCount = 0;
  288. BOOL bResult = FALSE;
  289. TCHAR szSQL[2048] = _T(""); // 长度可能会不够,_stprintf_s结果导致SQL语句不正确;
  290. if ( lpFilters && lpFilters[0] != _T('\0') )
  291. {
  292. _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), lpTableName, lpFilters);
  293. }
  294. else
  295. {
  296. _stprintf_s(szSQL, _T("select count(*) as cot from %s"), lpTableName);
  297. }
  298. EnterCriticalSection( &m_csAdo );
  299. bResult = GetADODateBaseStatus();
  300. if( FALSE == bResult ){
  301. LeaveCriticalSection( &m_csAdo );
  302. return -1;
  303. }
  304. // 获取记录数;
  305. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  306. LeaveCriticalSection( &m_csAdo );
  307. if( NULL == pRSet )
  308. return -1;
  309. bResult = OpenADORecordSet(pRSet, szSQL);
  310. if( FALSE == bResult ){
  311. DeleteADORecordSet(pRSet);
  312. return -1;
  313. }
  314. if( !pRSet->IsFieldNull(_T("cot")) )
  315. {
  316. pRSet->GetFieldValue(_T("cot"), nRecordCount);
  317. }
  318. else
  319. {
  320. nRecordCount = -1;
  321. // 没有记录则返回;
  322. DeleteADORecordSet(pRSet);
  323. return -1;
  324. }
  325. DeleteADORecordSet(pRSet);
  326. // 获取查询记录集;
  327. pRSet = new CADORecordset(m_pADODatabase);
  328. LeaveCriticalSection( &m_csAdo );
  329. if( NULL == pRSet )
  330. return -1;
  331. if ( lpFilters && lpFilters[0] != _T('\0') )
  332. _stprintf_s(szSQL, _T("select %s from %s where %s"), lpFields, lpTableName, lpFilters);
  333. else
  334. _stprintf_s(szSQL, _T("select %s from %s"), lpFields, lpTableName);
  335. bResult = OpenADORecordSet(pRSet, szSQL);
  336. if( FALSE == bResult )
  337. {
  338. DeleteADORecordSet(pRSet);
  339. return -1;
  340. }
  341. //int nFieldCount = pRSet->GetFieldCount();
  342. // 让回调函数处理返回的数据集结果;
  343. nRecordCount = ((RecordsetCallback)lpCallBack)(dwCallBackType, lpParamter, nRecordCount, pRSet);
  344. DeleteADORecordSet(pRSet);
  345. return nRecordCount;
  346. }
  347. int AdoImpl::GetFieldValueList(IN LPCTSTR lpTableName ,IN LPCTSTR lpFilters, IN LPCTSTR lpSql, OUT INT &nFieldCount, __out vector<TString>& vtRet)
  348. {
  349. TCHAR szSQL[1024] = _T("");
  350. _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), lpTableName, lpFilters);
  351. int nRecordCount = 0;
  352. _variant_t vtFieldValue;
  353. BOOL bResult = FALSE;
  354. EnterCriticalSection( &m_csAdo );
  355. bResult = GetADODateBaseStatus();
  356. if( false == bResult )
  357. {
  358. LeaveCriticalSection( &m_csAdo );
  359. return -1;
  360. }
  361. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  362. LeaveCriticalSection( &m_csAdo );
  363. if( NULL == pRSet )
  364. {
  365. //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL"));
  366. return -1;
  367. }
  368. bResult = OpenADORecordSet(pRSet, szSQL);
  369. if( FALSE == bResult )
  370. {
  371. DeleteADORecordSet(pRSet);
  372. return -1;
  373. }
  374. if( !pRSet->IsFieldNull(_T("cot")) )
  375. {
  376. pRSet->GetFieldValue(_T("cot"), nRecordCount);
  377. }
  378. else
  379. {
  380. nRecordCount = -1;
  381. }// end if( !pRSet->IsFieldNull(0) )
  382. DeleteADORecordSet(pRSet);
  383. pRSet = new CADORecordset(m_pADODatabase);
  384. LeaveCriticalSection( &m_csAdo );
  385. if( NULL == pRSet )
  386. {
  387. //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL"));
  388. return -1;
  389. }
  390. bResult = OpenADORecordSet(pRSet, lpSql);
  391. if( FALSE == bResult )
  392. {
  393. DeleteADORecordSet(pRSet);
  394. return -1;
  395. }
  396. nFieldCount = pRSet->GetFieldCount();
  397. #if 0
  398. for( int i = 0; i < nRecordCount; i++ )
  399. {
  400. for ( int n = 0; n < nFieldCount; n++)
  401. {
  402. if( !pRSet->IsFieldNull(n) )
  403. {
  404. pRSet->GetFieldValue(n, vtFieldValue);
  405. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  406. vtRet.push_back(strFieldValue);
  407. }
  408. else
  409. {
  410. vtRet.insert(vtRet.end(), _T(""));
  411. //LOG4C((LOG_NOTICE, "GetFieldValueList1 list1 is NULL"));
  412. }// end if( !pRSet->IsFieldNull(0) )
  413. }
  414. pRSet->MoveNext();
  415. }// end for( int i = 0; i < nRecordCount; i++ )
  416. #else
  417. for( int i = 0; i < nRecordCount*nFieldCount; i++ )
  418. {
  419. if( !pRSet->IsFieldNull(i%nFieldCount) )
  420. {
  421. pRSet->GetFieldValue(i%nFieldCount, vtFieldValue);
  422. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  423. vtRet.push_back(strFieldValue);
  424. }
  425. else
  426. {
  427. vtRet.insert(vtRet.end(), _T(""));
  428. }
  429. if ((i != 0) && (i%nFieldCount == 0))
  430. pRSet->MoveNext();
  431. }
  432. #endif
  433. DeleteADORecordSet(pRSet);
  434. return nRecordCount;
  435. }
  436. int AdoImpl::GetFieldValueList(IN LPCTSTR lpTableName ,IN LPCTSTR lpSql, OUT int &nFieldCount, OUT CArray<CStringArray,CStringArray>& strArray)
  437. {
  438. int nRecordCount = 0;
  439. _variant_t vtFieldValue;
  440. BOOL bResult = FALSE;
  441. EnterCriticalSection( &m_csAdo );
  442. bResult = GetADODateBaseStatus();
  443. if( FALSE == bResult )
  444. {
  445. LeaveCriticalSection( &m_csAdo );
  446. return -1;
  447. }
  448. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  449. LeaveCriticalSection( &m_csAdo );
  450. if( NULL == pRSet )
  451. {
  452. //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL"));
  453. return -1;
  454. }
  455. #if 0
  456. TCHAR szSQL[1024] = _T("");
  457. sprintf(szSQL,"select count(*) as cot from %s",pTableName);
  458. bResult = OpenADORecordSet(pRSet, szSQL);
  459. if( false == bResult )
  460. {
  461. DeleteADORecordSet(pRSet);
  462. return -1;
  463. }
  464. if( !pRSet->IsFieldNull("cot") )
  465. {
  466. pRSet->GetFieldValue("cot", nRecordCount);
  467. }
  468. else
  469. {
  470. nRecordCount = -1;
  471. }// end if( !pRSet->IsFieldNull(0) )
  472. DeleteADORecordSet(pRSet);
  473. //--------------------------------------------------------------------
  474. pRSet = new CADORecordset(m_pADODatabase);
  475. LeaveCriticalSection( &m_csAdo );
  476. if( NULL == pRSet )
  477. {
  478. //LOG4C((LOG_NOTICE, "GetFieldValueList1 pRSet == NULL"));
  479. return -1;
  480. }
  481. #endif
  482. bResult = OpenADORecordSet(pRSet, lpSql);
  483. if( FALSE == bResult )
  484. {
  485. DeleteADORecordSet(pRSet);
  486. return -1;
  487. }
  488. nRecordCount = pRSet->GetRecordCount();
  489. nFieldCount = pRSet->GetFieldCount();
  490. #if 1
  491. #if 1
  492. strArray.SetSize(nRecordCount,1);
  493. for( int i = 0; i < nRecordCount; i++ )
  494. {
  495. for ( int n = 0; n < nFieldCount; n++)
  496. {
  497. if( !pRSet->IsFieldNull(n) )
  498. {
  499. pRSet->GetFieldValue(n, vtFieldValue);
  500. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  501. strArray.ElementAt(i).Add(strFieldValue.c_str());
  502. }
  503. else
  504. {
  505. strArray.ElementAt(i).Add(_T(""));
  506. //LOG4C((LOG_NOTICE, "GetFieldValueList1 list1 is NULL"));
  507. }// end if( !pRSet->IsFieldNull(0) )
  508. }
  509. pRSet->MoveNext();
  510. }// end for( int i = 0; i < nRecordCount; i++ )
  511. #else
  512. strArray.SetSize(nRecordCount,1);
  513. int nIndex = 0;
  514. for( int i = 0; i < nRecordCount*nFieldCount; i++ )
  515. {
  516. if( !pRSet->IsFieldNull(i%nFieldCount) )
  517. {
  518. pRSet->GetFieldValue(i%nFieldCount, vtFieldValue);
  519. string strFieldValue = string((char*)(_bstr_t)vtFieldValue);
  520. //vtRet.push_back(strFieldValue);
  521. strArray.ElementAt(nIndex).Add(strFieldValue.c_str());
  522. }
  523. else
  524. {
  525. strArray.ElementAt(nIndex).Add("");
  526. }// end if( !pRSet->IsFieldNull(0) )
  527. if ((i != 0) && (i%nFieldCount == 0))
  528. {
  529. nIndex++;
  530. pRSet->MoveNext();
  531. }
  532. }// end for( int
  533. #endif
  534. #endif
  535. DeleteADORecordSet(pRSet);
  536. return nRecordCount;
  537. }
  538. int AdoImpl::GetClientServiceViewData(IN LPCTSTR lpSql, OUT CArray<CStringArray,CStringArray>& strArray,IN LPCTSTR lpFilters/* =NULL */)
  539. {
  540. int nFieldCount = 0;
  541. int nRecordCount = 0;
  542. _variant_t vtFieldValue;
  543. BOOL bResult = FALSE;
  544. EnterCriticalSection( &m_csAdo );
  545. bResult = GetADODateBaseStatus();
  546. if( false == bResult )
  547. {
  548. LeaveCriticalSection( &m_csAdo );
  549. return -1;
  550. }
  551. nRecordCount = GetTableRecordCount(_T("clientserviceview"), lpFilters);
  552. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  553. LeaveCriticalSection( &m_csAdo );
  554. if( NULL == pRSet )
  555. {
  556. return -1;
  557. }
  558. TCHAR szSQL[1024] = _T("");
  559. if(lpFilters && (_tcscmp(lpFilters,_T("")) != 0))
  560. _stprintf_s(szSQL, _T("%s where %s"), lpSql, lpFilters);
  561. else
  562. _stprintf_s(szSQL,_T("%s"), lpSql);
  563. bResult = OpenADORecordSet(pRSet, szSQL);
  564. if( FALSE == bResult )
  565. {
  566. DeleteADORecordSet(pRSet);
  567. return -1;
  568. }
  569. //nRecordCount = pRSet->GetRecordCount();
  570. nFieldCount = pRSet->GetFieldCount();
  571. strArray.SetSize(nRecordCount,1);
  572. for( int i = 0; i < nRecordCount; i++ )
  573. {
  574. if( !pRSet->IsFieldNull(_T("dindanid")) )
  575. {
  576. pRSet->GetFieldValue(_T("dindanid"), vtFieldValue);
  577. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  578. strArray.ElementAt(i).Add(strFieldValue.c_str());
  579. }
  580. else
  581. {
  582. strArray.ElementAt(i).Add(_T(""));
  583. }
  584. if( !pRSet->IsFieldNull(_T("name1")) )
  585. {
  586. pRSet->GetFieldValue(_T("name1"), vtFieldValue);
  587. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  588. strArray.ElementAt(i).Add(strFieldValue.c_str());
  589. }
  590. else
  591. {
  592. strArray.ElementAt(i).Add(_T(""));
  593. }
  594. pRSet->MoveNext();
  595. }// end for( int i = 0; i < nRecordCount; i++ )
  596. DeleteADORecordSet(pRSet);
  597. return nRecordCount;
  598. }
  599. int AdoImpl::GetTbl_dindan_Values(IN LPCTSTR lpTableName, IN LPCTSTR lpFilters, IN LPCTSTR lpSql, INT &nFieldCount, OUT vector<TString>& vtRet)
  600. {
  601. TCHAR szSQL[1024] = _T("");
  602. if(lpFilters == NULL || _tcscmp(lpFilters,_T("")) == 0)
  603. _stprintf_s(szSQL,_T("select count(*) as cot from %s"),lpTableName);
  604. else
  605. _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), lpTableName, lpFilters);
  606. int nRecordCount = 0;
  607. _variant_t vtFieldValue;
  608. BOOL bResult = FALSE;
  609. EnterCriticalSection( &m_csAdo );
  610. bResult = GetADODateBaseStatus();
  611. if( FALSE == bResult )
  612. {
  613. LeaveCriticalSection( &m_csAdo );
  614. return -1;
  615. }
  616. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  617. LeaveCriticalSection( &m_csAdo );
  618. if( NULL == pRSet )
  619. {
  620. return -1;
  621. }
  622. bResult = OpenADORecordSet(pRSet, szSQL);
  623. if( FALSE == bResult )
  624. {
  625. DeleteADORecordSet(pRSet);
  626. return -1;
  627. }
  628. if( !pRSet->IsFieldNull(_T("cot")) )
  629. {
  630. pRSet->GetFieldValue(_T("cot"), nRecordCount);
  631. }
  632. else
  633. {
  634. nRecordCount = -1;
  635. }// end if( !pRSet->IsFieldNull(0) )
  636. DeleteADORecordSet(pRSet);
  637. pRSet = new CADORecordset(m_pADODatabase);
  638. LeaveCriticalSection( &m_csAdo );
  639. if( NULL == pRSet )
  640. {
  641. return -1;
  642. }
  643. bResult = OpenADORecordSet(pRSet, lpSql);
  644. if( FALSE == bResult )
  645. {
  646. DeleteADORecordSet(pRSet);
  647. return -1;
  648. }
  649. nFieldCount = pRSet->GetFieldCount();
  650. for ( int i = 0; i < nRecordCount; i++)
  651. {
  652. if( !pRSet->IsFieldNull(_T("id")) )
  653. {
  654. pRSet->GetFieldValue(_T("id"), vtFieldValue);
  655. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  656. vtRet.push_back(strFieldValue);
  657. }
  658. else
  659. {
  660. vtRet.push_back(_T(""));
  661. }
  662. if( !pRSet->IsFieldNull(_T("money1")) )
  663. {
  664. pRSet->GetFieldValue(_T("money1"), vtFieldValue);
  665. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  666. vtRet.push_back(strFieldValue);
  667. }
  668. else
  669. {
  670. vtRet.push_back(_T(""));
  671. }
  672. if( !pRSet->IsFieldNull(_T("money2")) )
  673. {
  674. pRSet->GetFieldValue(_T("money2"), vtFieldValue);
  675. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  676. vtRet.push_back(strFieldValue);
  677. }
  678. else
  679. {
  680. vtRet.push_back(_T(""));
  681. }
  682. if( !pRSet->IsFieldNull(_T("money3")) )
  683. {
  684. pRSet->GetFieldValue(_T("money3"), vtFieldValue);
  685. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  686. vtRet.push_back(strFieldValue);
  687. }
  688. else
  689. {
  690. vtRet.push_back(_T(""));
  691. }
  692. if( !pRSet->IsFieldNull(_T("name1")) )
  693. {
  694. pRSet->GetFieldValue(_T("name1"), vtFieldValue);
  695. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  696. vtRet.push_back(strFieldValue);
  697. }
  698. else
  699. {
  700. vtRet.push_back(_T(""));
  701. }
  702. if( !pRSet->IsFieldNull(_T("name2")) )
  703. {
  704. pRSet->GetFieldValue(_T("name2"), vtFieldValue);
  705. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  706. vtRet.push_back(strFieldValue);
  707. }
  708. else
  709. {
  710. vtRet.push_back(_T(""));
  711. }
  712. if( !pRSet->IsFieldNull(_T("taoxiid")) )
  713. {
  714. pRSet->GetFieldValue(_T("taoxiid"), vtFieldValue);
  715. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  716. vtRet.push_back(strFieldValue);
  717. }
  718. else
  719. {
  720. vtRet.push_back(_T(""));
  721. }
  722. if( !pRSet->IsFieldNull(_T("taoxiname")) )
  723. {
  724. pRSet->GetFieldValue(_T("taoxiname"), vtFieldValue);
  725. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  726. vtRet.push_back(strFieldValue);
  727. }
  728. else
  729. {
  730. vtRet.push_back(_T(""));
  731. }
  732. if( !pRSet->IsFieldNull(_T("taoxijiage")) )
  733. {
  734. pRSet->GetFieldValue(_T("taoxijiage"), vtFieldValue);
  735. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  736. vtRet.push_back(strFieldValue);
  737. }
  738. else
  739. {
  740. vtRet.push_back(_T(""));
  741. }
  742. if( !pRSet->IsFieldNull(_T("taoxizs")) )
  743. {
  744. pRSet->GetFieldValue(_T("taoxizs"), vtFieldValue);
  745. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  746. vtRet.push_back(strFieldValue);
  747. }
  748. else
  749. {
  750. vtRet.push_back(_T(""));
  751. }
  752. if( !pRSet->IsFieldNull(_T("time1")) )
  753. {
  754. pRSet->GetFieldValue(_T("time1"), vtFieldValue);
  755. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  756. vtRet.push_back(strFieldValue);
  757. }
  758. else
  759. {
  760. vtRet.push_back(_T(""));
  761. }
  762. if( !pRSet->IsFieldNull(_T("time2")) )
  763. {
  764. pRSet->GetFieldValue(_T("time2"), vtFieldValue);
  765. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  766. vtRet.push_back(strFieldValue);
  767. }
  768. else
  769. {
  770. vtRet.push_back(_T(""));
  771. }
  772. if( !pRSet->IsFieldNull(_T("time3")) )
  773. {
  774. pRSet->GetFieldValue(_T("time3"), vtFieldValue);
  775. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  776. vtRet.push_back(strFieldValue);
  777. }
  778. else
  779. {
  780. vtRet.push_back(_T(""));
  781. }
  782. if( !pRSet->IsFieldNull(_T("bm")) )
  783. {
  784. pRSet->GetFieldValue(_T("bm"), vtFieldValue);
  785. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  786. vtRet.push_back(strFieldValue);
  787. }
  788. else
  789. {
  790. vtRet.push_back(_T(""));
  791. }
  792. if( !pRSet->IsFieldNull(_T("ren")) )
  793. {
  794. pRSet->GetFieldValue(_T("ren"), vtFieldValue);
  795. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  796. vtRet.push_back(strFieldValue);
  797. }
  798. else
  799. {
  800. vtRet.push_back(_T(""));
  801. }
  802. if( !pRSet->IsFieldNull(_T("discount")) )
  803. {
  804. pRSet->GetFieldValue(_T("discount"), vtFieldValue);
  805. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  806. vtRet.push_back(strFieldValue);
  807. }
  808. else
  809. {
  810. vtRet.push_back(_T(""));
  811. }
  812. if( !pRSet->IsFieldNull(_T("payed1")) )
  813. {
  814. pRSet->GetFieldValue(_T("payed1"), vtFieldValue);
  815. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  816. vtRet.push_back(strFieldValue);
  817. }
  818. else
  819. {
  820. vtRet.push_back(_T(""));
  821. }
  822. if( !pRSet->IsFieldNull(_T("payed2")) )
  823. {
  824. pRSet->GetFieldValue(_T("payed2"), vtFieldValue);
  825. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  826. vtRet.push_back(strFieldValue);
  827. }
  828. else
  829. {
  830. vtRet.push_back(_T(""));
  831. }
  832. if( !pRSet->IsFieldNull(_T("payed3")) )
  833. {
  834. pRSet->GetFieldValue(_T("payed3"), vtFieldValue);
  835. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  836. vtRet.push_back(strFieldValue);
  837. }
  838. else
  839. {
  840. vtRet.push_back(_T(""));
  841. }
  842. if( !pRSet->IsFieldNull(_T("payed4")) )
  843. {
  844. pRSet->GetFieldValue(_T("payed4"), vtFieldValue);
  845. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  846. vtRet.push_back(strFieldValue);
  847. }
  848. else
  849. {
  850. vtRet.push_back(_T(""));
  851. }
  852. if( !pRSet->IsFieldNull(_T("payed5")) )
  853. {
  854. pRSet->GetFieldValue(_T("payed5"), vtFieldValue);
  855. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  856. vtRet.push_back(strFieldValue);
  857. }
  858. else
  859. {
  860. vtRet.push_back(_T(""));
  861. }
  862. if( !pRSet->IsFieldNull(_T("time4")) )
  863. {
  864. pRSet->GetFieldValue(_T("time4"), vtFieldValue);
  865. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  866. vtRet.push_back(strFieldValue);
  867. }
  868. else
  869. {
  870. vtRet.push_back(_T(""));
  871. }
  872. if( !pRSet->IsFieldNull(_T("time5")) )
  873. {
  874. pRSet->GetFieldValue(_T("time5"), vtFieldValue);
  875. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  876. vtRet.push_back(strFieldValue);
  877. }
  878. else
  879. {
  880. vtRet.push_back(_T(""));
  881. }
  882. if( !pRSet->IsFieldNull(_T("takezs")) )
  883. {
  884. pRSet->GetFieldValue(_T("takezs"), vtFieldValue);
  885. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  886. vtRet.push_back(strFieldValue);
  887. }
  888. else
  889. {
  890. vtRet.push_back(_T(""));
  891. }
  892. if( !pRSet->IsFieldNull(_T("choosezs")) )
  893. {
  894. pRSet->GetFieldValue(_T("choosezs"), vtFieldValue);
  895. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  896. vtRet.push_back(strFieldValue);
  897. }
  898. else
  899. {
  900. vtRet.push_back(_T(""));
  901. }
  902. if( !pRSet->IsFieldNull(_T("status")) )
  903. {
  904. pRSet->GetFieldValue(_T("status"), vtFieldValue);
  905. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  906. vtRet.push_back(strFieldValue);
  907. }
  908. else
  909. {
  910. vtRet.push_back(_T(""));
  911. }
  912. if( !pRSet->IsFieldNull(_T("clothescount2")) )
  913. {
  914. pRSet->GetFieldValue(_T("clothescount2"), vtFieldValue);
  915. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  916. vtRet.push_back(strFieldValue);
  917. }
  918. else
  919. {
  920. vtRet.push_back(_T(""));
  921. }
  922. if( !pRSet->IsFieldNull(_T("outside2")) )
  923. {
  924. pRSet->GetFieldValue(_T("outside2"), vtFieldValue);
  925. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  926. vtRet.push_back(strFieldValue);
  927. }
  928. else
  929. {
  930. vtRet.push_back(_T(""));
  931. }
  932. if( !pRSet->IsFieldNull(_T("style")) )
  933. {
  934. pRSet->GetFieldValue(_T("style"), vtFieldValue);
  935. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  936. vtRet.push_back(strFieldValue);
  937. }
  938. else
  939. {
  940. vtRet.push_back(_T(""));
  941. }
  942. if( !pRSet->IsFieldNull(_T("payed3time")) )
  943. {
  944. pRSet->GetFieldValue(_T("payed3time"), vtFieldValue);
  945. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  946. vtRet.push_back(strFieldValue);
  947. }
  948. else
  949. {
  950. vtRet.push_back(_T(""));
  951. }
  952. if( !pRSet->IsFieldNull(_T("payed4ren")) )
  953. {
  954. pRSet->GetFieldValue(_T("payed4ren"), vtFieldValue);
  955. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  956. vtRet.push_back(strFieldValue);
  957. }
  958. else
  959. {
  960. vtRet.push_back(_T(""));
  961. }
  962. if( !pRSet->IsFieldNull(_T("payed4time")) )
  963. {
  964. pRSet->GetFieldValue(_T("payed4time"), vtFieldValue);
  965. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  966. vtRet.push_back(strFieldValue);
  967. }
  968. else
  969. {
  970. vtRet.push_back(_T(""));
  971. }
  972. if( !pRSet->IsFieldNull(_T("status2")) )
  973. {
  974. pRSet->GetFieldValue(_T("status2"), vtFieldValue);
  975. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  976. vtRet.push_back(strFieldValue);
  977. }
  978. else
  979. {
  980. vtRet.push_back(_T(""));
  981. }
  982. if( !pRSet->IsFieldNull(_T("status3")) )
  983. {
  984. pRSet->GetFieldValue(_T("status3"), vtFieldValue);
  985. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  986. vtRet.push_back(strFieldValue);
  987. }
  988. else
  989. {
  990. vtRet.push_back(_T(""));
  991. }
  992. if( !pRSet->IsFieldNull(_T("waiter1")) )
  993. {
  994. pRSet->GetFieldValue(_T("waiter1"), vtFieldValue);
  995. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  996. vtRet.push_back(strFieldValue);
  997. }
  998. else
  999. {
  1000. vtRet.push_back(_T(""));
  1001. }
  1002. if( !pRSet->IsFieldNull(_T("waiter2")) )
  1003. {
  1004. pRSet->GetFieldValue(_T("waiter2"), vtFieldValue);
  1005. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1006. vtRet.push_back(strFieldValue);
  1007. }
  1008. else
  1009. {
  1010. vtRet.push_back(_T(""));
  1011. }
  1012. if( !pRSet->IsFieldNull(_T("waiter3")) )
  1013. {
  1014. pRSet->GetFieldValue(_T("waiter3"), vtFieldValue);
  1015. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1016. vtRet.push_back(strFieldValue);
  1017. }
  1018. else
  1019. {
  1020. vtRet.push_back(_T(""));
  1021. }
  1022. if( !pRSet->IsFieldNull(_T("waiter4")) )
  1023. {
  1024. pRSet->GetFieldValue(_T("waiter4"), vtFieldValue);
  1025. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1026. vtRet.push_back(strFieldValue);
  1027. }
  1028. else
  1029. {
  1030. vtRet.push_back(_T(""));
  1031. }
  1032. if( !pRSet->IsFieldNull(_T("bz")) )
  1033. {
  1034. pRSet->GetFieldValue(_T("bz"), vtFieldValue);
  1035. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1036. vtRet.push_back(strFieldValue);
  1037. }
  1038. else
  1039. {
  1040. vtRet.push_back(_T(""));
  1041. }
  1042. if( !pRSet->IsFieldNull(_T("taketime")) )
  1043. {
  1044. pRSet->GetFieldValue(_T("taketime"), vtFieldValue);
  1045. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1046. vtRet.push_back(strFieldValue);
  1047. }
  1048. else
  1049. {
  1050. vtRet.push_back(_T(""));
  1051. }
  1052. if( !pRSet->IsFieldNull(_T("clothescount")) )
  1053. {
  1054. pRSet->GetFieldValue(_T("clothescount"), vtFieldValue);
  1055. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1056. vtRet.push_back(strFieldValue);
  1057. }
  1058. else
  1059. {
  1060. vtRet.push_back(_T(""));
  1061. }
  1062. if( !pRSet->IsFieldNull(_T("outside")) )
  1063. {
  1064. pRSet->GetFieldValue(_T("outside"), vtFieldValue);
  1065. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1066. vtRet.push_back(strFieldValue);
  1067. }
  1068. else
  1069. {
  1070. vtRet.push_back(_T(""));
  1071. }
  1072. if( !pRSet->IsFieldNull(_T("bz2")) )
  1073. {
  1074. pRSet->GetFieldValue(_T("bz2"), vtFieldValue);
  1075. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1076. vtRet.push_back(strFieldValue);
  1077. }
  1078. else
  1079. {
  1080. vtRet.push_back(_T(""));
  1081. }
  1082. if( !pRSet->IsFieldNull(_T("bz3")) )
  1083. {
  1084. pRSet->GetFieldValue(_T("bz3"), vtFieldValue);
  1085. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1086. vtRet.push_back(strFieldValue);
  1087. }
  1088. else
  1089. {
  1090. vtRet.push_back(_T(""));
  1091. }
  1092. if( !pRSet->IsFieldNull(_T("urgent")) )
  1093. {
  1094. pRSet->GetFieldValue(_T("urgent"), vtFieldValue);
  1095. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1096. vtRet.push_back(strFieldValue);
  1097. }
  1098. else
  1099. {
  1100. vtRet.push_back(_T(""));
  1101. }
  1102. if( !pRSet->IsFieldNull(_T("status4")) )
  1103. {
  1104. pRSet->GetFieldValue(_T("status4"), vtFieldValue);
  1105. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1106. vtRet.push_back(strFieldValue);
  1107. }
  1108. else
  1109. {
  1110. vtRet.push_back(_T(""));
  1111. }
  1112. if( !pRSet->IsFieldNull(_T("status5")) )
  1113. {
  1114. pRSet->GetFieldValue(_T("status5"), vtFieldValue);
  1115. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1116. vtRet.push_back(strFieldValue);
  1117. }
  1118. else
  1119. {
  1120. vtRet.push_back(_T(""));
  1121. }
  1122. if( !pRSet->IsFieldNull(_T("waiter5")) )
  1123. {
  1124. pRSet->GetFieldValue(_T("waiter5"), vtFieldValue);
  1125. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1126. vtRet.push_back(strFieldValue);
  1127. }
  1128. else
  1129. {
  1130. vtRet.push_back(_T(""));
  1131. }
  1132. if( !pRSet->IsFieldNull(_T("waiter6")) )
  1133. {
  1134. pRSet->GetFieldValue(_T("waiter6"), vtFieldValue);
  1135. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1136. vtRet.push_back(strFieldValue);
  1137. }
  1138. else
  1139. {
  1140. vtRet.push_back(_T(""));
  1141. }
  1142. if( !pRSet->IsFieldNull(_T("pinyin1")) )
  1143. {
  1144. pRSet->GetFieldValue(_T("pinyin1"), vtFieldValue);
  1145. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1146. vtRet.push_back(strFieldValue);
  1147. }
  1148. else
  1149. {
  1150. vtRet.push_back(_T(""));
  1151. }
  1152. if( !pRSet->IsFieldNull(_T("pinyin2")) )
  1153. {
  1154. pRSet->GetFieldValue(_T("pinyin2"), vtFieldValue);
  1155. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1156. vtRet.push_back(strFieldValue);
  1157. }
  1158. else
  1159. {
  1160. vtRet.push_back(_T(""));
  1161. }
  1162. if( !pRSet->IsFieldNull(_T("waiter7")) )
  1163. {
  1164. pRSet->GetFieldValue(_T("waiter7"), vtFieldValue);
  1165. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1166. vtRet.push_back(strFieldValue);
  1167. }
  1168. else
  1169. {
  1170. vtRet.push_back(_T(""));
  1171. }
  1172. if( !pRSet->IsFieldNull(_T("status6")) )
  1173. {
  1174. pRSet->GetFieldValue(_T("status6"), vtFieldValue);
  1175. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1176. vtRet.push_back(strFieldValue);
  1177. }
  1178. else
  1179. {
  1180. vtRet.push_back(_T(""));
  1181. }
  1182. if( !pRSet->IsFieldNull(_T("phone1")) )
  1183. {
  1184. pRSet->GetFieldValue(_T("phone1"), vtFieldValue);
  1185. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1186. vtRet.push_back(strFieldValue);
  1187. }
  1188. else
  1189. {
  1190. vtRet.push_back(_T(""));
  1191. }
  1192. if( !pRSet->IsFieldNull(_T("phone2")) )
  1193. {
  1194. pRSet->GetFieldValue(_T("phone2"), vtFieldValue);
  1195. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1196. vtRet.push_back(strFieldValue);
  1197. }
  1198. else
  1199. {
  1200. vtRet.push_back(_T(""));
  1201. }
  1202. if( !pRSet->IsFieldNull(_T("status7")) )
  1203. {
  1204. pRSet->GetFieldValue(_T("status7"), vtFieldValue);
  1205. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1206. vtRet.push_back(strFieldValue);
  1207. }
  1208. else
  1209. {
  1210. vtRet.push_back(_T(""));
  1211. }
  1212. if( !pRSet->IsFieldNull(_T("memberno")) )
  1213. {
  1214. pRSet->GetFieldValue(_T("memberno"), vtFieldValue);
  1215. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1216. vtRet.push_back(strFieldValue);
  1217. }
  1218. else
  1219. {
  1220. vtRet.push_back(_T(""));
  1221. }
  1222. if( !pRSet->IsFieldNull(_T("waiter8")) )
  1223. {
  1224. pRSet->GetFieldValue(_T("waiter8"), vtFieldValue);
  1225. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1226. vtRet.push_back(strFieldValue);
  1227. }
  1228. else
  1229. {
  1230. vtRet.push_back(_T(""));
  1231. }
  1232. if( !pRSet->IsFieldNull(_T("time6")) )
  1233. {
  1234. pRSet->GetFieldValue(_T("time6"), vtFieldValue);
  1235. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1236. vtRet.push_back(strFieldValue);
  1237. }
  1238. else
  1239. {
  1240. vtRet.push_back(_T(""));
  1241. }
  1242. if( !pRSet->IsFieldNull(_T("status8")) )
  1243. {
  1244. pRSet->GetFieldValue(_T("status8"), vtFieldValue);
  1245. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1246. vtRet.push_back(strFieldValue);
  1247. }
  1248. else
  1249. {
  1250. vtRet.push_back(_T(""));
  1251. }
  1252. if( !pRSet->IsFieldNull(_T("bruncount")) )
  1253. {
  1254. pRSet->GetFieldValue(_T("bruncount"), vtFieldValue);
  1255. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1256. vtRet.push_back(strFieldValue);
  1257. }
  1258. else
  1259. {
  1260. vtRet.push_back(_T(""));
  1261. }
  1262. if( !pRSet->IsFieldNull(_T("tichenren1")) )
  1263. {
  1264. pRSet->GetFieldValue(_T("tichenren1"), vtFieldValue);
  1265. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1266. vtRet.push_back(strFieldValue);
  1267. }
  1268. else
  1269. {
  1270. vtRet.push_back(_T(""));
  1271. }
  1272. if( !pRSet->IsFieldNull(_T("tichenren2")) )
  1273. {
  1274. pRSet->GetFieldValue(_T("tichenren2"), vtFieldValue);
  1275. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1276. vtRet.push_back(strFieldValue);
  1277. }
  1278. else
  1279. {
  1280. vtRet.push_back(_T(""));
  1281. }
  1282. if( !pRSet->IsFieldNull(_T("tichenren3")) )
  1283. {
  1284. pRSet->GetFieldValue(_T("tichenren3"), vtFieldValue);
  1285. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1286. vtRet.push_back(strFieldValue);
  1287. }
  1288. else
  1289. {
  1290. vtRet.push_back(_T(""));
  1291. }
  1292. if( !pRSet->IsFieldNull(_T("tichenren4")) )
  1293. {
  1294. pRSet->GetFieldValue(_T("tichenren4"), vtFieldValue);
  1295. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1296. vtRet.push_back(strFieldValue);
  1297. }
  1298. else
  1299. {
  1300. vtRet.push_back(_T(""));
  1301. }
  1302. if( !pRSet->IsFieldNull(_T("tichenren5")) )
  1303. {
  1304. pRSet->GetFieldValue(_T("tichenren5"), vtFieldValue);
  1305. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1306. vtRet.push_back(strFieldValue);
  1307. }
  1308. else
  1309. {
  1310. vtRet.push_back(_T(""));
  1311. }
  1312. if( !pRSet->IsFieldNull(_T("send1")) )
  1313. {
  1314. pRSet->GetFieldValue(_T("send1"), vtFieldValue);
  1315. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1316. vtRet.push_back(strFieldValue);
  1317. }
  1318. else
  1319. {
  1320. vtRet.push_back(_T(""));
  1321. }
  1322. if( !pRSet->IsFieldNull(_T("send2")) )
  1323. {
  1324. pRSet->GetFieldValue(_T("send2"), vtFieldValue);
  1325. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1326. vtRet.push_back(strFieldValue);
  1327. }
  1328. else
  1329. {
  1330. vtRet.push_back(_T(""));
  1331. }
  1332. if( !pRSet->IsFieldNull(_T("send3")) )
  1333. {
  1334. pRSet->GetFieldValue(_T("send3"), vtFieldValue);
  1335. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1336. vtRet.push_back(strFieldValue);
  1337. }
  1338. else
  1339. {
  1340. vtRet.push_back(_T(""));
  1341. }
  1342. if( !pRSet->IsFieldNull(_T("datetime4")) )
  1343. {
  1344. pRSet->GetFieldValue(_T("datetime4"), vtFieldValue);
  1345. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1346. vtRet.push_back(strFieldValue);
  1347. }
  1348. else
  1349. {
  1350. vtRet.push_back(_T(""));
  1351. }
  1352. if( !pRSet->IsFieldNull(_T("datetime5")) )
  1353. {
  1354. pRSet->GetFieldValue(_T("datetime5"), vtFieldValue);
  1355. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1356. vtRet.push_back(strFieldValue);
  1357. }
  1358. else
  1359. {
  1360. vtRet.push_back(_T(""));
  1361. }
  1362. if( !pRSet->IsFieldNull(_T("datetime6")) )
  1363. {
  1364. pRSet->GetFieldValue(_T("datetime6"), vtFieldValue);
  1365. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1366. vtRet.push_back(strFieldValue);
  1367. }
  1368. else
  1369. {
  1370. vtRet.push_back(_T(""));
  1371. }
  1372. if( !pRSet->IsFieldNull(_T("waiter12")) )
  1373. {
  1374. pRSet->GetFieldValue(_T("waiter12"), vtFieldValue);
  1375. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1376. vtRet.push_back(strFieldValue);
  1377. }
  1378. else
  1379. {
  1380. vtRet.push_back(_T(""));
  1381. }
  1382. if( !pRSet->IsFieldNull(_T("waiter13")) )
  1383. {
  1384. pRSet->GetFieldValue(_T("waiter13"), vtFieldValue);
  1385. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1386. vtRet.push_back(strFieldValue);
  1387. }
  1388. else
  1389. {
  1390. vtRet.push_back(_T(""));
  1391. }
  1392. if( !pRSet->IsFieldNull(_T("waiter14")) )
  1393. {
  1394. pRSet->GetFieldValue(_T("waiter14"), vtFieldValue);
  1395. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1396. vtRet.push_back(strFieldValue);
  1397. }
  1398. else
  1399. {
  1400. vtRet.push_back(_T(""));
  1401. }
  1402. if( !pRSet->IsFieldNull(_T("waiter22")) )
  1403. {
  1404. pRSet->GetFieldValue(_T("waiter22"), vtFieldValue);
  1405. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1406. vtRet.push_back(strFieldValue);
  1407. }
  1408. else
  1409. {
  1410. vtRet.push_back(_T(""));
  1411. }
  1412. if( !pRSet->IsFieldNull(_T("waiter23")) )
  1413. {
  1414. pRSet->GetFieldValue(_T("waiter23"), vtFieldValue);
  1415. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1416. vtRet.push_back(strFieldValue);
  1417. }
  1418. else
  1419. {
  1420. vtRet.push_back(_T(""));
  1421. }
  1422. if( !pRSet->IsFieldNull(_T("waiter24")) )
  1423. {
  1424. pRSet->GetFieldValue(_T("waiter24"), vtFieldValue);
  1425. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1426. vtRet.push_back(strFieldValue);
  1427. }
  1428. else
  1429. {
  1430. vtRet.push_back(_T(""));
  1431. }
  1432. if( !pRSet->IsFieldNull(_T("waiter1rate")) )
  1433. {
  1434. pRSet->GetFieldValue(_T("waiter1rate"), vtFieldValue);
  1435. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1436. vtRet.push_back(strFieldValue);
  1437. }
  1438. else
  1439. {
  1440. vtRet.push_back(_T(""));
  1441. }
  1442. if( !pRSet->IsFieldNull(_T("waiter12rate")) )
  1443. {
  1444. pRSet->GetFieldValue(_T("waiter12rate"), vtFieldValue);
  1445. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1446. vtRet.push_back(strFieldValue);
  1447. }
  1448. else
  1449. {
  1450. vtRet.push_back(_T(""));
  1451. }
  1452. if( !pRSet->IsFieldNull(_T("waiter13rate")) )
  1453. {
  1454. pRSet->GetFieldValue(_T("waiter13rate"), vtFieldValue);
  1455. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1456. vtRet.push_back(strFieldValue);
  1457. }
  1458. else
  1459. {
  1460. vtRet.push_back(_T(""));
  1461. }
  1462. if( !pRSet->IsFieldNull(_T("waiter14rate")) )
  1463. {
  1464. pRSet->GetFieldValue(_T("waiter14rate"), vtFieldValue);
  1465. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1466. vtRet.push_back(strFieldValue);
  1467. }
  1468. else
  1469. {
  1470. vtRet.push_back(_T(""));
  1471. }
  1472. if( !pRSet->IsFieldNull(_T("waiter2rate")) )
  1473. {
  1474. pRSet->GetFieldValue(_T("waiter2rate"), vtFieldValue);
  1475. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1476. vtRet.push_back(strFieldValue);
  1477. }
  1478. else
  1479. {
  1480. vtRet.push_back(_T(""));
  1481. }
  1482. if( !pRSet->IsFieldNull(_T("waiter22rate")) )
  1483. {
  1484. pRSet->GetFieldValue(_T("waiter22rate"), vtFieldValue);
  1485. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1486. vtRet.push_back(strFieldValue);
  1487. }
  1488. else
  1489. {
  1490. vtRet.push_back(_T(""));
  1491. }
  1492. if( !pRSet->IsFieldNull(_T("waiter23rate")) )
  1493. {
  1494. pRSet->GetFieldValue(_T("waiter23rate"), vtFieldValue);
  1495. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1496. vtRet.push_back(strFieldValue);
  1497. }
  1498. else
  1499. {
  1500. vtRet.push_back(_T(""));
  1501. }
  1502. if( !pRSet->IsFieldNull(_T("waiter24rate")) )
  1503. {
  1504. pRSet->GetFieldValue(_T("waiter24rate"), vtFieldValue);
  1505. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1506. vtRet.push_back(strFieldValue);
  1507. }
  1508. else
  1509. {
  1510. vtRet.push_back(_T(""));
  1511. }
  1512. if( !pRSet->IsFieldNull(_T("ren2")) )
  1513. {
  1514. pRSet->GetFieldValue(_T("ren2"), vtFieldValue);
  1515. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1516. vtRet.push_back(strFieldValue);
  1517. }
  1518. else
  1519. {
  1520. vtRet.push_back(_T(""));
  1521. }
  1522. if( !pRSet->IsFieldNull(_T("renrate")) )
  1523. {
  1524. pRSet->GetFieldValue(_T("renrate"), vtFieldValue);
  1525. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1526. vtRet.push_back(strFieldValue);
  1527. }
  1528. else
  1529. {
  1530. vtRet.push_back(_T(""));
  1531. }
  1532. if( !pRSet->IsFieldNull(_T("ren2rate")) )
  1533. {
  1534. pRSet->GetFieldValue(_T("ren2rate"), vtFieldValue);
  1535. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1536. vtRet.push_back(strFieldValue);
  1537. }
  1538. else
  1539. {
  1540. vtRet.push_back(_T(""));
  1541. }
  1542. if( !pRSet->IsFieldNull(_T("txtype")) )
  1543. {
  1544. pRSet->GetFieldValue(_T("txtype"), vtFieldValue);
  1545. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1546. vtRet.push_back(strFieldValue);
  1547. }
  1548. else
  1549. {
  1550. vtRet.push_back(_T(""));
  1551. }
  1552. if( !pRSet->IsFieldNull(_T("delphotos")) )
  1553. {
  1554. pRSet->GetFieldValue(_T("delphotos"), vtFieldValue);
  1555. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1556. vtRet.push_back(strFieldValue);
  1557. }
  1558. else
  1559. {
  1560. vtRet.push_back(_T(""));
  1561. }
  1562. if( !pRSet->IsFieldNull(_T("delphotos2")) )
  1563. {
  1564. pRSet->GetFieldValue(_T("delphotos2"), vtFieldValue);
  1565. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1566. vtRet.push_back(strFieldValue);
  1567. }
  1568. else
  1569. {
  1570. vtRet.push_back(_T(""));
  1571. }
  1572. if( !pRSet->IsFieldNull(_T("growthtxselname")) )
  1573. {
  1574. pRSet->GetFieldValue(_T("growthtxselname"), vtFieldValue);
  1575. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1576. vtRet.push_back(strFieldValue);
  1577. }
  1578. else
  1579. {
  1580. vtRet.push_back(_T(""));
  1581. }
  1582. if( !pRSet->IsFieldNull(_T("designno")) )
  1583. {
  1584. pRSet->GetFieldValue(_T("designno"), vtFieldValue);
  1585. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1586. vtRet.push_back(strFieldValue);
  1587. }
  1588. else
  1589. {
  1590. vtRet.push_back(_T(""));
  1591. }
  1592. if( !pRSet->IsFieldNull(_T("designreplaceno")) )
  1593. {
  1594. pRSet->GetFieldValue(_T("designreplaceno"), vtFieldValue);
  1595. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1596. vtRet.push_back(strFieldValue);
  1597. }
  1598. else
  1599. {
  1600. vtRet.push_back(_T(""));
  1601. }
  1602. if( !pRSet->IsFieldNull(_T("size")) )
  1603. {
  1604. pRSet->GetFieldValue(_T("size"), vtFieldValue);
  1605. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1606. vtRet.push_back(strFieldValue);
  1607. }
  1608. else
  1609. {
  1610. vtRet.push_back(_T(""));
  1611. }
  1612. if( !pRSet->IsFieldNull(_T("dindantype")) )
  1613. {
  1614. pRSet->GetFieldValue(_T("dindantype"), vtFieldValue);
  1615. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1616. vtRet.push_back(strFieldValue);
  1617. }
  1618. else
  1619. {
  1620. vtRet.push_back(_T(""));
  1621. }
  1622. if( !pRSet->IsFieldNull(_T("contractno1")) )
  1623. {
  1624. pRSet->GetFieldValue(_T("contractno1"), vtFieldValue);
  1625. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1626. vtRet.push_back(strFieldValue);
  1627. }
  1628. else
  1629. {
  1630. vtRet.push_back(_T(""));
  1631. }
  1632. if( !pRSet->IsFieldNull(_T("contractno2")) )
  1633. {
  1634. pRSet->GetFieldValue(_T("contractno2"), vtFieldValue);
  1635. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1636. vtRet.push_back(strFieldValue);
  1637. }
  1638. else
  1639. {
  1640. vtRet.push_back(_T(""));
  1641. }
  1642. if( !pRSet->IsFieldNull(_T("cfno")) )
  1643. {
  1644. pRSet->GetFieldValue(_T("cfno"), vtFieldValue);
  1645. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1646. vtRet.push_back(strFieldValue);
  1647. }
  1648. else
  1649. {
  1650. vtRet.push_back(_T(""));
  1651. }
  1652. if( !pRSet->IsFieldNull(_T("calldate")) )
  1653. {
  1654. pRSet->GetFieldValue(_T("calldate"), vtFieldValue);
  1655. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1656. vtRet.push_back(strFieldValue);
  1657. }
  1658. else
  1659. {
  1660. vtRet.push_back(_T(""));
  1661. }
  1662. if( !pRSet->IsFieldNull(_T("from")) )
  1663. {
  1664. pRSet->GetFieldValue(_T("from"), vtFieldValue);
  1665. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1666. vtRet.push_back(strFieldValue);
  1667. }
  1668. else
  1669. {
  1670. vtRet.push_back(_T(""));
  1671. }
  1672. if( !pRSet->IsFieldNull(_T("reason")) )
  1673. {
  1674. pRSet->GetFieldValue(_T("reason"), vtFieldValue);
  1675. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1676. vtRet.push_back(strFieldValue);
  1677. }
  1678. else
  1679. {
  1680. vtRet.push_back(_T(""));
  1681. }
  1682. if( !pRSet->IsFieldNull(_T("time7")) )
  1683. {
  1684. pRSet->GetFieldValue(_T("time7"), vtFieldValue);
  1685. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1686. vtRet.push_back(strFieldValue);
  1687. }
  1688. else
  1689. {
  1690. vtRet.push_back(_T(""));
  1691. }
  1692. if( !pRSet->IsFieldNull(_T("time8")) )
  1693. {
  1694. pRSet->GetFieldValue(_T("time8"), vtFieldValue);
  1695. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1696. vtRet.push_back(strFieldValue);
  1697. }
  1698. else
  1699. {
  1700. vtRet.push_back(_T(""));
  1701. }
  1702. if( !pRSet->IsFieldNull(_T("time9")) )
  1703. {
  1704. pRSet->GetFieldValue(_T("time9"), vtFieldValue);
  1705. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1706. vtRet.push_back(strFieldValue);
  1707. }
  1708. else
  1709. {
  1710. vtRet.push_back(_T(""));
  1711. }
  1712. if( !pRSet->IsFieldNull(_T("time10")) )
  1713. {
  1714. pRSet->GetFieldValue(_T("time10"), vtFieldValue);
  1715. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1716. vtRet.push_back(strFieldValue);
  1717. }
  1718. else
  1719. {
  1720. vtRet.push_back(_T(""));
  1721. }
  1722. if( !pRSet->IsFieldNull(_T("authorize")) )
  1723. {
  1724. pRSet->GetFieldValue(_T("authorize"), vtFieldValue);
  1725. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1726. vtRet.push_back(strFieldValue);
  1727. }
  1728. else
  1729. {
  1730. vtRet.push_back(_T(""));
  1731. }
  1732. if( !pRSet->IsFieldNull(_T("discount2")) )
  1733. {
  1734. pRSet->GetFieldValue(_T("discount2"), vtFieldValue);
  1735. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1736. vtRet.push_back(strFieldValue);
  1737. }
  1738. else
  1739. {
  1740. vtRet.push_back(_T(""));
  1741. }
  1742. if( !pRSet->IsFieldNull(_T("authorize2")) )
  1743. {
  1744. pRSet->GetFieldValue(_T("authorize2"), vtFieldValue);
  1745. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1746. vtRet.push_back(strFieldValue);
  1747. }
  1748. else
  1749. {
  1750. vtRet.push_back(_T(""));
  1751. }
  1752. if( !pRSet->IsFieldNull(_T("bz4")) )
  1753. {
  1754. pRSet->GetFieldValue(_T("bz4"), vtFieldValue);
  1755. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1756. vtRet.push_back(strFieldValue);
  1757. }
  1758. else
  1759. {
  1760. vtRet.push_back(_T(""));
  1761. }
  1762. if( !pRSet->IsFieldNull(_T("satisfaction1")) )
  1763. {
  1764. pRSet->GetFieldValue(_T("satisfaction1"), vtFieldValue);
  1765. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1766. vtRet.push_back(strFieldValue);
  1767. }
  1768. else
  1769. {
  1770. vtRet.push_back(_T(""));
  1771. }
  1772. if( !pRSet->IsFieldNull(_T("satisfaction2")) )
  1773. {
  1774. pRSet->GetFieldValue(_T("satisfaction2"), vtFieldValue);
  1775. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1776. vtRet.push_back(strFieldValue);
  1777. }
  1778. else
  1779. {
  1780. vtRet.push_back(_T(""));
  1781. }
  1782. if( !pRSet->IsFieldNull(_T("satisfaction3")) )
  1783. {
  1784. pRSet->GetFieldValue(_T("satisfaction3"), vtFieldValue);
  1785. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1786. vtRet.push_back(strFieldValue);
  1787. }
  1788. else
  1789. {
  1790. vtRet.push_back(_T(""));
  1791. }
  1792. if( !pRSet->IsFieldNull(_T("satisfaction4")) )
  1793. {
  1794. pRSet->GetFieldValue(_T("satisfaction4"), vtFieldValue);
  1795. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1796. vtRet.push_back(strFieldValue);
  1797. }
  1798. else
  1799. {
  1800. vtRet.push_back(_T(""));
  1801. }
  1802. if( !pRSet->IsFieldNull(_T("satisfaction5")) )
  1803. {
  1804. pRSet->GetFieldValue(_T("satisfaction5"), vtFieldValue);
  1805. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1806. vtRet.push_back(strFieldValue);
  1807. }
  1808. else
  1809. {
  1810. vtRet.push_back(_T(""));
  1811. }
  1812. if( !pRSet->IsFieldNull(_T("satisfaction6")) )
  1813. {
  1814. pRSet->GetFieldValue(_T("satisfaction6"), vtFieldValue);
  1815. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1816. vtRet.push_back(strFieldValue);
  1817. }
  1818. else
  1819. {
  1820. vtRet.push_back(_T(""));
  1821. }
  1822. if( !pRSet->IsFieldNull(_T("satisfaction7")) )
  1823. {
  1824. pRSet->GetFieldValue(_T("satisfaction7"), vtFieldValue);
  1825. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1826. vtRet.push_back(strFieldValue);
  1827. }
  1828. else
  1829. {
  1830. vtRet.push_back(_T(""));
  1831. }
  1832. if( !pRSet->IsFieldNull(_T("bz5")) )
  1833. {
  1834. pRSet->GetFieldValue(_T("bz5"), vtFieldValue);
  1835. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1836. vtRet.push_back(strFieldValue);
  1837. }
  1838. else
  1839. {
  1840. vtRet.push_back(_T(""));
  1841. }
  1842. if( !pRSet->IsFieldNull(_T("send4")) )
  1843. {
  1844. pRSet->GetFieldValue(_T("send4"), vtFieldValue);
  1845. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1846. vtRet.push_back(strFieldValue);
  1847. }
  1848. else
  1849. {
  1850. vtRet.push_back(_T(""));
  1851. }
  1852. if( !pRSet->IsFieldNull(_T("send5")) )
  1853. {
  1854. pRSet->GetFieldValue(_T("send5"), vtFieldValue);
  1855. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1856. vtRet.push_back(strFieldValue);
  1857. }
  1858. else
  1859. {
  1860. vtRet.push_back(_T(""));
  1861. }
  1862. if( !pRSet->IsFieldNull(_T("waiter9")) )
  1863. {
  1864. pRSet->GetFieldValue(_T("waiter9"), vtFieldValue);
  1865. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1866. vtRet.push_back(strFieldValue);
  1867. }
  1868. else
  1869. {
  1870. vtRet.push_back(_T(""));
  1871. }
  1872. if( !pRSet->IsFieldNull(_T("curno")) )
  1873. {
  1874. pRSet->GetFieldValue(_T("curno"), vtFieldValue);
  1875. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1876. vtRet.push_back(strFieldValue);
  1877. }
  1878. else
  1879. {
  1880. vtRet.push_back(_T(""));
  1881. }
  1882. if( !pRSet->IsFieldNull(_T("xplrr")) )
  1883. {
  1884. pRSet->GetFieldValue(_T("xplrr"), vtFieldValue);
  1885. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1886. vtRet.push_back(strFieldValue);
  1887. }
  1888. else
  1889. {
  1890. vtRet.push_back(_T(""));
  1891. }
  1892. if( !pRSet->IsFieldNull(_T("xplrtime")) )
  1893. {
  1894. pRSet->GetFieldValue(_T("xplrtime"), vtFieldValue);
  1895. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1896. vtRet.push_back(strFieldValue);
  1897. }
  1898. else
  1899. {
  1900. vtRet.push_back(_T(""));
  1901. }
  1902. if( !pRSet->IsFieldNull(_T("satisfaction8")) )
  1903. {
  1904. pRSet->GetFieldValue(_T("satisfaction8"), vtFieldValue);
  1905. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1906. vtRet.push_back(strFieldValue);
  1907. }
  1908. else
  1909. {
  1910. vtRet.push_back(_T(""));
  1911. }
  1912. if( !pRSet->IsFieldNull(_T("VisitPeople1")) )
  1913. {
  1914. pRSet->GetFieldValue(_T("VisitPeople1"), vtFieldValue);
  1915. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1916. vtRet.push_back(strFieldValue);
  1917. }
  1918. else
  1919. {
  1920. vtRet.push_back(_T(""));
  1921. }
  1922. if( !pRSet->IsFieldNull(_T("VisitPeople2")) )
  1923. {
  1924. pRSet->GetFieldValue(_T("VisitPeople2"), vtFieldValue);
  1925. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1926. vtRet.push_back(strFieldValue);
  1927. }
  1928. else
  1929. {
  1930. vtRet.push_back(_T(""));
  1931. }
  1932. if( !pRSet->IsFieldNull(_T("VisitPeople3")) )
  1933. {
  1934. pRSet->GetFieldValue(_T("VisitPeople3"), vtFieldValue);
  1935. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1936. vtRet.push_back(strFieldValue);
  1937. }
  1938. else
  1939. {
  1940. vtRet.push_back(_T(""));
  1941. }
  1942. if( !pRSet->IsFieldNull(_T("VisitPeople4")) )
  1943. {
  1944. pRSet->GetFieldValue(_T("VisitPeople4"), vtFieldValue);
  1945. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1946. vtRet.push_back(strFieldValue);
  1947. }
  1948. else
  1949. {
  1950. vtRet.push_back(_T(""));
  1951. }
  1952. if( !pRSet->IsFieldNull(_T("VisitPeople5")) )
  1953. {
  1954. pRSet->GetFieldValue(_T("VisitPeople5"), vtFieldValue);
  1955. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1956. vtRet.push_back(strFieldValue);
  1957. }
  1958. else
  1959. {
  1960. vtRet.push_back(_T(""));
  1961. }
  1962. if( !pRSet->IsFieldNull(_T("VisitPeople6")) )
  1963. {
  1964. pRSet->GetFieldValue(_T("VisitPeople6"), vtFieldValue);
  1965. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1966. vtRet.push_back(strFieldValue);
  1967. }
  1968. else
  1969. {
  1970. vtRet.push_back(_T(""));
  1971. }
  1972. if( !pRSet->IsFieldNull(_T("VisitPeople7")) )
  1973. {
  1974. pRSet->GetFieldValue(_T("VisitPeople7"), vtFieldValue);
  1975. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1976. vtRet.push_back(strFieldValue);
  1977. }
  1978. else
  1979. {
  1980. vtRet.push_back(_T(""));
  1981. }
  1982. if( !pRSet->IsFieldNull(_T("VisitPeople8")) )
  1983. {
  1984. pRSet->GetFieldValue(_T("VisitPeople8"), vtFieldValue);
  1985. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1986. vtRet.push_back(strFieldValue);
  1987. }
  1988. else
  1989. {
  1990. vtRet.push_back(_T(""));
  1991. }
  1992. if( !pRSet->IsFieldNull(_T("VisitTime1")) )
  1993. {
  1994. pRSet->GetFieldValue(_T("VisitTime1"), vtFieldValue);
  1995. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  1996. vtRet.push_back(strFieldValue);
  1997. }
  1998. else
  1999. {
  2000. vtRet.push_back(_T(""));
  2001. }
  2002. if( !pRSet->IsFieldNull(_T("VisitTime2")) )
  2003. {
  2004. pRSet->GetFieldValue(_T("VisitTime2"), vtFieldValue);
  2005. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2006. vtRet.push_back(strFieldValue);
  2007. }
  2008. else
  2009. {
  2010. vtRet.push_back(_T(""));
  2011. }
  2012. if( !pRSet->IsFieldNull(_T("VisitTime3")) )
  2013. {
  2014. pRSet->GetFieldValue(_T("VisitTime3"), vtFieldValue);
  2015. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2016. vtRet.push_back(strFieldValue);
  2017. }
  2018. else
  2019. {
  2020. vtRet.push_back(_T(""));
  2021. }
  2022. if( !pRSet->IsFieldNull(_T("VisitTime4")) )
  2023. {
  2024. pRSet->GetFieldValue(_T("VisitTime4"), vtFieldValue);
  2025. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2026. vtRet.push_back(strFieldValue);
  2027. }
  2028. else
  2029. {
  2030. vtRet.push_back(_T(""));
  2031. }
  2032. if( !pRSet->IsFieldNull(_T("VisitTime5")) )
  2033. {
  2034. pRSet->GetFieldValue(_T("VisitTime5"), vtFieldValue);
  2035. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2036. vtRet.push_back(strFieldValue);
  2037. }
  2038. else
  2039. {
  2040. vtRet.push_back(_T(""));
  2041. }
  2042. if( !pRSet->IsFieldNull(_T("VisitTime6")) )
  2043. {
  2044. pRSet->GetFieldValue(_T("VisitTime6"), vtFieldValue);
  2045. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2046. vtRet.push_back(strFieldValue);
  2047. }
  2048. else
  2049. {
  2050. vtRet.push_back(_T(""));
  2051. }
  2052. if( !pRSet->IsFieldNull(_T("VisitTime7")) )
  2053. {
  2054. pRSet->GetFieldValue(_T("VisitTime7"), vtFieldValue);
  2055. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2056. vtRet.push_back(strFieldValue);
  2057. }
  2058. else
  2059. {
  2060. vtRet.push_back(_T(""));
  2061. }
  2062. if( !pRSet->IsFieldNull(_T("VisitTime8")) )
  2063. {
  2064. pRSet->GetFieldValue(_T("VisitTime8"), vtFieldValue);
  2065. TString strFieldValue = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2066. vtRet.push_back(strFieldValue);
  2067. }
  2068. else
  2069. {
  2070. vtRet.push_back(_T(""));
  2071. }
  2072. pRSet->MoveNext();
  2073. }
  2074. DeleteADORecordSet(pRSet);
  2075. return nRecordCount;
  2076. }
  2077. int AdoImpl::GetTbl_dindan_Values(IN CONST TCHAR *pTableName, IN CONST TCHAR *pFilters, IN CONST TCHAR *pSql, INT &nFieldCount, OUT vector<Tbl_dindan>& vtRet)
  2078. {
  2079. TCHAR szSQL[1024] = _T("");
  2080. _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), pTableName, pFilters);
  2081. int nRecordCount = 0;
  2082. _variant_t vtFieldValue;
  2083. BOOL bResult = FALSE;
  2084. EnterCriticalSection( &m_csAdo );
  2085. bResult = GetADODateBaseStatus();
  2086. if( FALSE == bResult )
  2087. {
  2088. LeaveCriticalSection( &m_csAdo );
  2089. return -1;
  2090. }
  2091. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  2092. LeaveCriticalSection( &m_csAdo );
  2093. if( NULL == pRSet )
  2094. {
  2095. return -1;
  2096. }
  2097. bResult = OpenADORecordSet(pRSet, szSQL);
  2098. if( FALSE == bResult )
  2099. {
  2100. DeleteADORecordSet(pRSet);
  2101. return -1;
  2102. }
  2103. if( !pRSet->IsFieldNull(_T("cot")) )
  2104. {
  2105. pRSet->GetFieldValue(_T("cot"), nRecordCount);
  2106. }
  2107. else
  2108. {
  2109. nRecordCount = -1;
  2110. }// end if( !pRSet->IsFieldNull(0) )
  2111. DeleteADORecordSet(pRSet);
  2112. pRSet = new CADORecordset(m_pADODatabase);
  2113. LeaveCriticalSection( &m_csAdo );
  2114. if( NULL == pRSet )
  2115. {
  2116. return -1;
  2117. }
  2118. bResult = OpenADORecordSet(pRSet, pSql);
  2119. if( FALSE == bResult )
  2120. {
  2121. DeleteADORecordSet(pRSet);
  2122. return -1;
  2123. }
  2124. nFieldCount = pRSet->GetFieldCount();
  2125. for ( int i = 0; i < nRecordCount; i++)
  2126. {
  2127. Tbl_dindan tagVal;
  2128. if( !pRSet->IsFieldNull(_T("id")) )
  2129. {
  2130. pRSet->GetFieldValue(_T("id"), vtFieldValue);
  2131. tagVal._id = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2132. }
  2133. else
  2134. {
  2135. tagVal._id = _T("");
  2136. }
  2137. if( !pRSet->IsFieldNull(_T("money1")) )
  2138. {
  2139. pRSet->GetFieldValue(_T("money1"), vtFieldValue);
  2140. tagVal._money1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2141. }
  2142. else
  2143. {
  2144. tagVal._money1 = _T("");
  2145. }
  2146. if( !pRSet->IsFieldNull(_T("money2")) )
  2147. {
  2148. pRSet->GetFieldValue(_T("money2"), vtFieldValue);
  2149. tagVal._money2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2150. }
  2151. else
  2152. {
  2153. tagVal._money2 = _T("");
  2154. }
  2155. if( !pRSet->IsFieldNull(_T("money3")) )
  2156. {
  2157. pRSet->GetFieldValue(_T("money3"), vtFieldValue);
  2158. tagVal._money3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2159. }
  2160. else
  2161. {
  2162. tagVal._money3 = _T("");
  2163. }
  2164. if( !pRSet->IsFieldNull(_T("name1")) )
  2165. {
  2166. pRSet->GetFieldValue(_T("name1"), vtFieldValue);
  2167. tagVal._name1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2168. }
  2169. else
  2170. {
  2171. tagVal._name1 = _T("");
  2172. }
  2173. if( !pRSet->IsFieldNull(_T("name2")) )
  2174. {
  2175. pRSet->GetFieldValue(_T("name2"), vtFieldValue);
  2176. tagVal._name2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2177. }
  2178. else
  2179. {
  2180. tagVal._name2 = _T("");
  2181. }
  2182. if( !pRSet->IsFieldNull(_T("taoxiid")) )
  2183. {
  2184. pRSet->GetFieldValue(_T("taoxiid"), vtFieldValue);
  2185. tagVal._taoxiid = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2186. }
  2187. else
  2188. {
  2189. tagVal._taoxiid = _T("");
  2190. }
  2191. if( !pRSet->IsFieldNull(_T("taoxiname")) )
  2192. {
  2193. pRSet->GetFieldValue(_T("taoxiname"), vtFieldValue);
  2194. tagVal._taoxiname = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2195. }
  2196. else
  2197. {
  2198. tagVal._taoxiname = _T("");
  2199. }
  2200. if( !pRSet->IsFieldNull(_T("taoxijiage")) )
  2201. {
  2202. pRSet->GetFieldValue(_T("taoxijiage"), vtFieldValue);
  2203. tagVal._taoxijiage = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2204. }
  2205. else
  2206. {
  2207. tagVal._taoxijiage = _T("");
  2208. }
  2209. if( !pRSet->IsFieldNull(_T("taoxizs")) )
  2210. {
  2211. pRSet->GetFieldValue(_T("taoxizs"), vtFieldValue);
  2212. tagVal._taoxizs = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2213. }
  2214. else
  2215. {
  2216. tagVal._taoxizs = _T("");
  2217. }
  2218. if( !pRSet->IsFieldNull(_T("time1")) )
  2219. {
  2220. pRSet->GetFieldValue(_T("time1"), vtFieldValue);
  2221. tagVal._time1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2222. }
  2223. else
  2224. {
  2225. tagVal._time1 = _T("");
  2226. }
  2227. if( !pRSet->IsFieldNull(_T("time2")) )
  2228. {
  2229. pRSet->GetFieldValue(_T("time2"), vtFieldValue);
  2230. tagVal._time2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2231. }
  2232. else
  2233. {
  2234. tagVal._time2 = _T("");
  2235. }
  2236. if( !pRSet->IsFieldNull(_T("time3")) )
  2237. {
  2238. pRSet->GetFieldValue(_T("time3"), vtFieldValue);
  2239. tagVal._time3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2240. }
  2241. else
  2242. {
  2243. tagVal._time3 = _T("");
  2244. }
  2245. if( !pRSet->IsFieldNull(_T("bm")) )
  2246. {
  2247. pRSet->GetFieldValue(_T("bm"), vtFieldValue);
  2248. tagVal._bm = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2249. }
  2250. else
  2251. {
  2252. tagVal._bm = _T("");
  2253. }
  2254. if( !pRSet->IsFieldNull(_T("ren")) )
  2255. {
  2256. pRSet->GetFieldValue(_T("ren"), vtFieldValue);
  2257. tagVal._ren = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2258. }
  2259. else
  2260. {
  2261. tagVal._ren = _T("");
  2262. }
  2263. if( !pRSet->IsFieldNull(_T("discount")) )
  2264. {
  2265. pRSet->GetFieldValue(_T("discount"), vtFieldValue);
  2266. tagVal._discount = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2267. }
  2268. else
  2269. {
  2270. tagVal._discount = _T("");
  2271. }
  2272. if( !pRSet->IsFieldNull(_T("payed1")) )
  2273. {
  2274. pRSet->GetFieldValue(_T("payed1"), vtFieldValue);
  2275. tagVal._payed1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2276. }
  2277. else
  2278. {
  2279. tagVal._payed1 = _T("");
  2280. }
  2281. if( !pRSet->IsFieldNull(_T("payed2")) )
  2282. {
  2283. pRSet->GetFieldValue(_T("payed2"), vtFieldValue);
  2284. tagVal._payed2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2285. }
  2286. else
  2287. {
  2288. tagVal._payed2 = _T("");
  2289. }
  2290. if( !pRSet->IsFieldNull(_T("payed3")) )
  2291. {
  2292. pRSet->GetFieldValue(_T("payed3"), vtFieldValue);
  2293. tagVal._payed3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2294. }
  2295. else
  2296. {
  2297. tagVal._payed3 = _T("");
  2298. }
  2299. if( !pRSet->IsFieldNull(_T("payed4")) )
  2300. {
  2301. pRSet->GetFieldValue(_T("payed4"), vtFieldValue);
  2302. tagVal._payed4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2303. }
  2304. else
  2305. {
  2306. tagVal._payed4 = _T("");
  2307. }
  2308. if( !pRSet->IsFieldNull(_T("payed5")) )
  2309. {
  2310. pRSet->GetFieldValue(_T("payed5"), vtFieldValue);
  2311. tagVal._payed5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2312. }
  2313. else
  2314. {
  2315. tagVal._payed5 = _T("");
  2316. }
  2317. if( !pRSet->IsFieldNull(_T("time4")) )
  2318. {
  2319. pRSet->GetFieldValue(_T("time4"), vtFieldValue);
  2320. tagVal._time4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2321. }
  2322. else
  2323. {
  2324. tagVal._time4 = _T("");
  2325. }
  2326. if( !pRSet->IsFieldNull(_T("time5")) )
  2327. {
  2328. pRSet->GetFieldValue(_T("time5"), vtFieldValue);
  2329. tagVal._time5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2330. }
  2331. else
  2332. {
  2333. tagVal._time5 = _T("");
  2334. }
  2335. if( !pRSet->IsFieldNull(_T("takezs")) )
  2336. {
  2337. pRSet->GetFieldValue(_T("takezs"), vtFieldValue);
  2338. tagVal._takezs = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2339. }
  2340. else
  2341. {
  2342. tagVal._takezs = _T("");
  2343. }
  2344. if( !pRSet->IsFieldNull(_T("choosezs")) )
  2345. {
  2346. pRSet->GetFieldValue(_T("choosezs"), vtFieldValue);
  2347. tagVal._choosezs = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2348. }
  2349. else
  2350. {
  2351. tagVal._choosezs = _T("");
  2352. }
  2353. if( !pRSet->IsFieldNull(_T("status")) )
  2354. {
  2355. pRSet->GetFieldValue(_T("status"), vtFieldValue);
  2356. tagVal._status = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2357. }
  2358. else
  2359. {
  2360. tagVal._status = _T("");
  2361. }
  2362. if( !pRSet->IsFieldNull(_T("clothescount2")) )
  2363. {
  2364. pRSet->GetFieldValue(_T("clothescount2"), vtFieldValue);
  2365. tagVal._clothescount2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2366. }
  2367. else
  2368. {
  2369. tagVal._clothescount2 = _T("");
  2370. }
  2371. if( !pRSet->IsFieldNull(_T("outside2")) )
  2372. {
  2373. pRSet->GetFieldValue(_T("outside2"), vtFieldValue);
  2374. tagVal._outside2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2375. }
  2376. else
  2377. {
  2378. tagVal._outside2 = _T("");
  2379. }
  2380. if( !pRSet->IsFieldNull(_T("style")) )
  2381. {
  2382. pRSet->GetFieldValue(_T("style"), vtFieldValue);
  2383. tagVal._style = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2384. }
  2385. else
  2386. {
  2387. tagVal._style = _T("");
  2388. }
  2389. if( !pRSet->IsFieldNull(_T("payed3time")) )
  2390. {
  2391. pRSet->GetFieldValue(_T("payed3time"), vtFieldValue);
  2392. tagVal._payed3time = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2393. }
  2394. else
  2395. {
  2396. tagVal._payed3time = _T("");
  2397. }
  2398. if( !pRSet->IsFieldNull(_T("payed4ren")) )
  2399. {
  2400. pRSet->GetFieldValue(_T("payed4ren"), vtFieldValue);
  2401. tagVal._payed4ren = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2402. }
  2403. else
  2404. {
  2405. tagVal._payed4ren = _T("");
  2406. }
  2407. if( !pRSet->IsFieldNull(_T("payed4time")) )
  2408. {
  2409. pRSet->GetFieldValue(_T("payed4time"), vtFieldValue);
  2410. tagVal._payed4time = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2411. }
  2412. else
  2413. {
  2414. tagVal._payed4time = _T("");
  2415. }
  2416. if( !pRSet->IsFieldNull(_T("status2")) )
  2417. {
  2418. pRSet->GetFieldValue(_T("status2"), vtFieldValue);
  2419. tagVal._status2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2420. }
  2421. else
  2422. {
  2423. tagVal._status2 = _T("");
  2424. }
  2425. if( !pRSet->IsFieldNull(_T("status3")) )
  2426. {
  2427. pRSet->GetFieldValue(_T("status3"), vtFieldValue);
  2428. tagVal._status3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2429. }
  2430. else
  2431. {
  2432. tagVal._status3 = _T("");
  2433. }
  2434. if( !pRSet->IsFieldNull(_T("waiter1")) )
  2435. {
  2436. pRSet->GetFieldValue(_T("waiter1"), vtFieldValue);
  2437. tagVal._waiter1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2438. }
  2439. else
  2440. {
  2441. tagVal._waiter1 = _T("");
  2442. }
  2443. if( !pRSet->IsFieldNull(_T("waiter2")) )
  2444. {
  2445. pRSet->GetFieldValue(_T("waiter2"), vtFieldValue);
  2446. tagVal._waiter2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2447. }
  2448. else
  2449. {
  2450. tagVal._waiter2 = _T("");
  2451. }
  2452. if( !pRSet->IsFieldNull(_T("waiter3")) )
  2453. {
  2454. pRSet->GetFieldValue(_T("waiter3"), vtFieldValue);
  2455. tagVal._waiter3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2456. }
  2457. else
  2458. {
  2459. tagVal._waiter3 = _T("");
  2460. }
  2461. if( !pRSet->IsFieldNull(_T("waiter4")) )
  2462. {
  2463. pRSet->GetFieldValue(_T("waiter4"), vtFieldValue);
  2464. tagVal._waiter4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2465. }
  2466. else
  2467. {
  2468. tagVal._waiter4 = _T("");
  2469. }
  2470. if( !pRSet->IsFieldNull(_T("bz")) )
  2471. {
  2472. pRSet->GetFieldValue(_T("bz"), vtFieldValue);
  2473. tagVal._bz = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2474. }
  2475. else
  2476. {
  2477. tagVal._bz = _T("");
  2478. }
  2479. if( !pRSet->IsFieldNull(_T("taketime")) )
  2480. {
  2481. pRSet->GetFieldValue(_T("taketime"), vtFieldValue);
  2482. tagVal._taketime = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2483. }
  2484. else
  2485. {
  2486. tagVal._taketime = _T("");
  2487. }
  2488. if( !pRSet->IsFieldNull(_T("clothescount")) )
  2489. {
  2490. pRSet->GetFieldValue(_T("clothescount"), vtFieldValue);
  2491. tagVal._clothescount = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2492. }
  2493. else
  2494. {
  2495. tagVal._clothescount = _T("");
  2496. }
  2497. if( !pRSet->IsFieldNull(_T("outside")) )
  2498. {
  2499. pRSet->GetFieldValue(_T("outside"), vtFieldValue);
  2500. tagVal._outside = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2501. }
  2502. else
  2503. {
  2504. tagVal._outside = _T("");
  2505. }
  2506. if( !pRSet->IsFieldNull(_T("bz2")) )
  2507. {
  2508. pRSet->GetFieldValue(_T("bz2"), vtFieldValue);
  2509. tagVal._bz2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2510. }
  2511. else
  2512. {
  2513. tagVal._bz2 = _T("");
  2514. }
  2515. if( !pRSet->IsFieldNull(_T("bz3")) )
  2516. {
  2517. pRSet->GetFieldValue(_T("bz3"), vtFieldValue);
  2518. tagVal._bz3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2519. }
  2520. else
  2521. {
  2522. tagVal._bz3 = _T("");
  2523. }
  2524. if( !pRSet->IsFieldNull(_T("urgent")) )
  2525. {
  2526. pRSet->GetFieldValue(_T("urgent"), vtFieldValue);
  2527. tagVal._urgent = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2528. }
  2529. else
  2530. {
  2531. tagVal._urgent = _T("");
  2532. }
  2533. if( !pRSet->IsFieldNull(_T("status4")) )
  2534. {
  2535. pRSet->GetFieldValue(_T("status4"), vtFieldValue);
  2536. tagVal._status4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2537. }
  2538. else
  2539. {
  2540. tagVal._status4 = _T("");
  2541. }
  2542. if( !pRSet->IsFieldNull(_T("status5")) )
  2543. {
  2544. pRSet->GetFieldValue(_T("status5"), vtFieldValue);
  2545. tagVal._status5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2546. }
  2547. else
  2548. {
  2549. tagVal._status5 = _T("");
  2550. }
  2551. if( !pRSet->IsFieldNull(_T("waiter5")) )
  2552. {
  2553. pRSet->GetFieldValue(_T("waiter5"), vtFieldValue);
  2554. tagVal._waiter5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2555. }
  2556. else
  2557. {
  2558. tagVal._waiter5 = _T("");
  2559. }
  2560. if( !pRSet->IsFieldNull(_T("waiter6")) )
  2561. {
  2562. pRSet->GetFieldValue(_T("waiter6"), vtFieldValue);
  2563. tagVal._waiter6 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2564. }
  2565. else
  2566. {
  2567. tagVal._waiter6 = _T("");
  2568. }
  2569. if( !pRSet->IsFieldNull(_T("pinyin1")) )
  2570. {
  2571. pRSet->GetFieldValue(_T("pinyin1"), vtFieldValue);
  2572. tagVal._pinyin1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2573. }
  2574. else
  2575. {
  2576. tagVal._pinyin1 = _T("");
  2577. }
  2578. if( !pRSet->IsFieldNull(_T("pinyin2")) )
  2579. {
  2580. pRSet->GetFieldValue(_T("pinyin2"), vtFieldValue);
  2581. tagVal._pinyin2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2582. }
  2583. else
  2584. {
  2585. tagVal._pinyin2 = _T("");
  2586. }
  2587. if( !pRSet->IsFieldNull(_T("waiter7")) )
  2588. {
  2589. pRSet->GetFieldValue(_T("waiter7"), vtFieldValue);
  2590. tagVal._waiter7 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2591. }
  2592. else
  2593. {
  2594. tagVal._waiter7 = _T("");
  2595. }
  2596. if( !pRSet->IsFieldNull(_T("status6")) )
  2597. {
  2598. pRSet->GetFieldValue(_T("status6"), vtFieldValue);
  2599. tagVal._status6 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2600. }
  2601. else
  2602. {
  2603. tagVal._status6 = _T("");
  2604. }
  2605. if( !pRSet->IsFieldNull(_T("phone1")) )
  2606. {
  2607. pRSet->GetFieldValue(_T("phone1"), vtFieldValue);
  2608. tagVal._phone1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2609. }
  2610. else
  2611. {
  2612. tagVal._phone1 = _T("");
  2613. }
  2614. if( !pRSet->IsFieldNull(_T("phone2")) )
  2615. {
  2616. pRSet->GetFieldValue(_T("phone2"), vtFieldValue);
  2617. tagVal._phone2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2618. }
  2619. else
  2620. {
  2621. tagVal._phone2 = _T("");
  2622. }
  2623. if( !pRSet->IsFieldNull(_T("status7")) )
  2624. {
  2625. pRSet->GetFieldValue(_T("status7"), vtFieldValue);
  2626. tagVal._status7 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2627. }
  2628. else
  2629. {
  2630. tagVal._status7 = _T("");
  2631. }
  2632. if( !pRSet->IsFieldNull(_T("memberno")) )
  2633. {
  2634. pRSet->GetFieldValue(_T("memberno"), vtFieldValue);
  2635. tagVal._memberno = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2636. }
  2637. else
  2638. {
  2639. tagVal._memberno = _T("");
  2640. }
  2641. if( !pRSet->IsFieldNull(_T("waiter8")) )
  2642. {
  2643. pRSet->GetFieldValue(_T("waiter8"), vtFieldValue);
  2644. tagVal._waiter8 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2645. }
  2646. else
  2647. {
  2648. tagVal._waiter8 = _T("");
  2649. }
  2650. if( !pRSet->IsFieldNull(_T("time6")) )
  2651. {
  2652. pRSet->GetFieldValue(_T("time6"), vtFieldValue);
  2653. tagVal._time6 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2654. }
  2655. else
  2656. {
  2657. tagVal._time6 = _T("");
  2658. }
  2659. if( !pRSet->IsFieldNull(_T("status8")) )
  2660. {
  2661. pRSet->GetFieldValue(_T("status8"), vtFieldValue);
  2662. tagVal._status8 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2663. }
  2664. else
  2665. {
  2666. tagVal._status8 = _T("");
  2667. }
  2668. if( !pRSet->IsFieldNull(_T("bruncount")) )
  2669. {
  2670. pRSet->GetFieldValue(_T("bruncount"), vtFieldValue);
  2671. tagVal._bruncount = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2672. }
  2673. else
  2674. {
  2675. tagVal._bruncount = _T("");
  2676. }
  2677. if( !pRSet->IsFieldNull(_T("tichenren1")) )
  2678. {
  2679. pRSet->GetFieldValue(_T("tichenren1"), vtFieldValue);
  2680. tagVal._tichenren1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2681. }
  2682. else
  2683. {
  2684. tagVal._tichenren1 = _T("");
  2685. }
  2686. if( !pRSet->IsFieldNull(_T("tichenren2")) )
  2687. {
  2688. pRSet->GetFieldValue(_T("tichenren2"), vtFieldValue);
  2689. tagVal._tichenren2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2690. }
  2691. else
  2692. {
  2693. tagVal._tichenren2 = _T("");
  2694. }
  2695. if( !pRSet->IsFieldNull(_T("tichenren3")) )
  2696. {
  2697. pRSet->GetFieldValue(_T("tichenren3"), vtFieldValue);
  2698. tagVal._tichenren3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2699. }
  2700. else
  2701. {
  2702. tagVal._tichenren3 = _T("");
  2703. }
  2704. if( !pRSet->IsFieldNull(_T("tichenren4")) )
  2705. {
  2706. pRSet->GetFieldValue(_T("tichenren4"), vtFieldValue);
  2707. tagVal._tichenren4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2708. }
  2709. else
  2710. {
  2711. tagVal._tichenren4 = _T("");
  2712. }
  2713. if( !pRSet->IsFieldNull(_T("tichenren5")) )
  2714. {
  2715. pRSet->GetFieldValue(_T("tichenren5"), vtFieldValue);
  2716. tagVal._tichenren5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2717. }
  2718. else
  2719. {
  2720. tagVal._tichenren5 = _T("");
  2721. }
  2722. if( !pRSet->IsFieldNull(_T("send1")) )
  2723. {
  2724. pRSet->GetFieldValue(_T("send1"), vtFieldValue);
  2725. tagVal._send1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2726. }
  2727. else
  2728. {
  2729. tagVal._send1 = _T("");
  2730. }
  2731. if( !pRSet->IsFieldNull(_T("send2")) )
  2732. {
  2733. pRSet->GetFieldValue(_T("send2"), vtFieldValue);
  2734. tagVal._send2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2735. }
  2736. else
  2737. {
  2738. tagVal._send2 = _T("");
  2739. }
  2740. if( !pRSet->IsFieldNull(_T("send3")) )
  2741. {
  2742. pRSet->GetFieldValue(_T("send3"), vtFieldValue);
  2743. tagVal._send3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2744. }
  2745. else
  2746. {
  2747. tagVal._send3 = _T("");
  2748. }
  2749. if( !pRSet->IsFieldNull(_T("datetime4")) )
  2750. {
  2751. pRSet->GetFieldValue(_T("datetime4"), vtFieldValue);
  2752. tagVal._datetime4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2753. }
  2754. else
  2755. {
  2756. tagVal._datetime4 = _T("");
  2757. }
  2758. if( !pRSet->IsFieldNull(_T("datetime5")) )
  2759. {
  2760. pRSet->GetFieldValue(_T("datetime5"), vtFieldValue);
  2761. tagVal._datetime5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2762. }
  2763. else
  2764. {
  2765. tagVal._datetime5 = _T("");
  2766. }
  2767. if( !pRSet->IsFieldNull(_T("datetime6")) )
  2768. {
  2769. pRSet->GetFieldValue(_T("datetime6"), vtFieldValue);
  2770. tagVal._datetime6 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2771. }
  2772. else
  2773. {
  2774. tagVal._datetime6 = _T("");
  2775. }
  2776. if( !pRSet->IsFieldNull(_T("waiter12")) )
  2777. {
  2778. pRSet->GetFieldValue(_T("waiter12"), vtFieldValue);
  2779. tagVal._waiter12 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2780. }
  2781. else
  2782. {
  2783. tagVal._waiter12 = _T("");
  2784. }
  2785. if( !pRSet->IsFieldNull(_T("waiter13")) )
  2786. {
  2787. pRSet->GetFieldValue(_T("waiter13"), vtFieldValue);
  2788. tagVal._waiter13 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2789. }
  2790. else
  2791. {
  2792. tagVal._waiter13 = _T("");
  2793. }
  2794. if( !pRSet->IsFieldNull(_T("waiter14")) )
  2795. {
  2796. pRSet->GetFieldValue(_T("waiter14"), vtFieldValue);
  2797. tagVal._waiter14 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2798. }
  2799. else
  2800. {
  2801. tagVal._waiter14 = _T("");
  2802. }
  2803. if( !pRSet->IsFieldNull(_T("waiter22")) )
  2804. {
  2805. pRSet->GetFieldValue(_T("waiter22"), vtFieldValue);
  2806. tagVal._waiter22 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2807. }
  2808. else
  2809. {
  2810. tagVal._waiter22 = _T("");
  2811. }
  2812. if( !pRSet->IsFieldNull(_T("waiter23")) )
  2813. {
  2814. pRSet->GetFieldValue(_T("waiter23"), vtFieldValue);
  2815. tagVal._waiter23 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2816. }
  2817. else
  2818. {
  2819. tagVal._waiter23 = _T("");
  2820. }
  2821. if( !pRSet->IsFieldNull(_T("waiter24")) )
  2822. {
  2823. pRSet->GetFieldValue(_T("waiter24"), vtFieldValue);
  2824. tagVal._waiter24 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2825. }
  2826. else
  2827. {
  2828. tagVal._waiter24 = _T("");
  2829. }
  2830. if( !pRSet->IsFieldNull(_T("waiter1rate")) )
  2831. {
  2832. pRSet->GetFieldValue(_T("waiter1rate"), vtFieldValue);
  2833. tagVal._waiter1rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2834. }
  2835. else
  2836. {
  2837. tagVal._waiter1rate = _T("");
  2838. }
  2839. if( !pRSet->IsFieldNull(_T("waiter12rate")) )
  2840. {
  2841. pRSet->GetFieldValue(_T("waiter12rate"), vtFieldValue);
  2842. tagVal._waiter12rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2843. }
  2844. else
  2845. {
  2846. tagVal._waiter12rate = _T("");
  2847. }
  2848. if( !pRSet->IsFieldNull(_T("waiter13rate")) )
  2849. {
  2850. pRSet->GetFieldValue(_T("waiter13rate"), vtFieldValue);
  2851. tagVal._waiter13rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2852. }
  2853. else
  2854. {
  2855. tagVal._waiter13rate = _T("");
  2856. }
  2857. if( !pRSet->IsFieldNull(_T("waiter14rate")) )
  2858. {
  2859. pRSet->GetFieldValue(_T("waiter14rate"), vtFieldValue);
  2860. tagVal._waiter14rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2861. }
  2862. else
  2863. {
  2864. tagVal._waiter14rate = _T("");
  2865. }
  2866. if( !pRSet->IsFieldNull(_T("waiter2rate")) )
  2867. {
  2868. pRSet->GetFieldValue(_T("waiter2rate"), vtFieldValue);
  2869. tagVal._waiter2rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2870. }
  2871. else
  2872. {
  2873. tagVal._waiter2rate = _T("");
  2874. }
  2875. if( !pRSet->IsFieldNull(_T("waiter22rate")) )
  2876. {
  2877. pRSet->GetFieldValue(_T("waiter22rate"), vtFieldValue);
  2878. tagVal._waiter22rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2879. }
  2880. else
  2881. {
  2882. tagVal._waiter22rate = _T("");
  2883. }
  2884. if( !pRSet->IsFieldNull(_T("waiter23rate")) )
  2885. {
  2886. pRSet->GetFieldValue(_T("waiter23rate"), vtFieldValue);
  2887. tagVal._waiter23rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2888. }
  2889. else
  2890. {
  2891. tagVal._waiter23rate = _T("");
  2892. }
  2893. if( !pRSet->IsFieldNull(_T("waiter24rate")) )
  2894. {
  2895. pRSet->GetFieldValue(_T("waiter24rate"), vtFieldValue);
  2896. tagVal._waiter24rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2897. }
  2898. else
  2899. {
  2900. tagVal._waiter24rate = _T("");
  2901. }
  2902. if( !pRSet->IsFieldNull(_T("ren2")) )
  2903. {
  2904. pRSet->GetFieldValue(_T("ren2"), vtFieldValue);
  2905. tagVal._ren2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2906. }
  2907. else
  2908. {
  2909. tagVal._ren2 = _T("");
  2910. }
  2911. if( !pRSet->IsFieldNull(_T("renrate")) )
  2912. {
  2913. pRSet->GetFieldValue(_T("renrate"), vtFieldValue);
  2914. tagVal._renrate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2915. }
  2916. else
  2917. {
  2918. tagVal._renrate = _T("");
  2919. }
  2920. if( !pRSet->IsFieldNull(_T("ren2rate")) )
  2921. {
  2922. pRSet->GetFieldValue(_T("ren2rate"), vtFieldValue);
  2923. tagVal._ren2rate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2924. }
  2925. else
  2926. {
  2927. tagVal._ren2rate = _T("");
  2928. }
  2929. if( !pRSet->IsFieldNull(_T("txtype")) )
  2930. {
  2931. pRSet->GetFieldValue(_T("txtype"), vtFieldValue);
  2932. tagVal._txtype = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2933. }
  2934. else
  2935. {
  2936. tagVal._txtype = _T("");
  2937. }
  2938. if( !pRSet->IsFieldNull(_T("delphotos")) )
  2939. {
  2940. pRSet->GetFieldValue(_T("delphotos"), vtFieldValue);
  2941. tagVal._delphotos = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2942. }
  2943. else
  2944. {
  2945. tagVal._delphotos = _T("");
  2946. }
  2947. if( !pRSet->IsFieldNull(_T("delphotos2")) )
  2948. {
  2949. pRSet->GetFieldValue(_T("delphotos2"), vtFieldValue);
  2950. tagVal._delphotos2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2951. }
  2952. else
  2953. {
  2954. tagVal._delphotos2 = _T("");
  2955. }
  2956. if( !pRSet->IsFieldNull(_T("growthtxselname")) )
  2957. {
  2958. pRSet->GetFieldValue(_T("growthtxselname"), vtFieldValue);
  2959. tagVal._growthtxselname = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2960. }
  2961. else
  2962. {
  2963. tagVal._growthtxselname = _T("");
  2964. }
  2965. if( !pRSet->IsFieldNull(_T("designno")) )
  2966. {
  2967. pRSet->GetFieldValue(_T("designno"), vtFieldValue);
  2968. tagVal._designno = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2969. }
  2970. else
  2971. {
  2972. tagVal._designno = _T("");
  2973. }
  2974. if( !pRSet->IsFieldNull(_T("designreplaceno")) )
  2975. {
  2976. pRSet->GetFieldValue(_T("designreplaceno"), vtFieldValue);
  2977. tagVal._designreplaceno = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2978. }
  2979. else
  2980. {
  2981. tagVal._designreplaceno = _T("");
  2982. }
  2983. if( !pRSet->IsFieldNull(_T("size")) )
  2984. {
  2985. pRSet->GetFieldValue(_T("size"), vtFieldValue);
  2986. tagVal._size = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2987. }
  2988. else
  2989. {
  2990. tagVal._size = _T("");
  2991. }
  2992. if( !pRSet->IsFieldNull(_T("dindantype")) )
  2993. {
  2994. pRSet->GetFieldValue(_T("dindantype"), vtFieldValue);
  2995. tagVal._dindantype = TString((TCHAR*)(_bstr_t)vtFieldValue);
  2996. }
  2997. else
  2998. {
  2999. tagVal._dindantype = _T("");
  3000. }
  3001. if( !pRSet->IsFieldNull(_T("contractno1")) )
  3002. {
  3003. pRSet->GetFieldValue(_T("contractno1"), vtFieldValue);
  3004. tagVal._contractno1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3005. }
  3006. else
  3007. {
  3008. tagVal._contractno1 = _T("");
  3009. }
  3010. if( !pRSet->IsFieldNull(_T("contractno2")) )
  3011. {
  3012. pRSet->GetFieldValue(_T("contractno2"), vtFieldValue);
  3013. tagVal._contractno2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3014. }
  3015. else
  3016. {
  3017. tagVal._contractno2 = _T("");
  3018. }
  3019. if( !pRSet->IsFieldNull(_T("cfno")) )
  3020. {
  3021. pRSet->GetFieldValue(_T("cfno"), vtFieldValue);
  3022. tagVal._cfno = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3023. }
  3024. else
  3025. {
  3026. tagVal._cfno = _T("");
  3027. }
  3028. if( !pRSet->IsFieldNull(_T("calldate")) )
  3029. {
  3030. pRSet->GetFieldValue(_T("calldate"), vtFieldValue);
  3031. tagVal._calldate = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3032. }
  3033. else
  3034. {
  3035. tagVal._calldate = _T("");
  3036. }
  3037. if( !pRSet->IsFieldNull(_T("from")) )
  3038. {
  3039. pRSet->GetFieldValue(_T("from"), vtFieldValue);
  3040. tagVal._from = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3041. }
  3042. else
  3043. {
  3044. tagVal._from = _T("");
  3045. }
  3046. if( !pRSet->IsFieldNull(_T("reason")) )
  3047. {
  3048. pRSet->GetFieldValue(_T("reason"), vtFieldValue);
  3049. tagVal._reason = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3050. }
  3051. else
  3052. {
  3053. tagVal._reason = _T("");
  3054. }
  3055. if( !pRSet->IsFieldNull(_T("time7")) )
  3056. {
  3057. pRSet->GetFieldValue(_T("time7"), vtFieldValue);
  3058. tagVal._time7 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3059. }
  3060. else
  3061. {
  3062. tagVal._time7 = _T("");
  3063. }
  3064. if( !pRSet->IsFieldNull(_T("time8")) )
  3065. {
  3066. pRSet->GetFieldValue(_T("time8"), vtFieldValue);
  3067. tagVal._time8 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3068. }
  3069. else
  3070. {
  3071. tagVal._time8 = _T("");
  3072. }
  3073. if( !pRSet->IsFieldNull(_T("time9")) )
  3074. {
  3075. pRSet->GetFieldValue(_T("time9"), vtFieldValue);
  3076. tagVal._time9 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3077. }
  3078. else
  3079. {
  3080. tagVal._time9 = _T("");
  3081. }
  3082. if( !pRSet->IsFieldNull(_T("time10")) )
  3083. {
  3084. pRSet->GetFieldValue(_T("time10"), vtFieldValue);
  3085. tagVal._time10 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3086. }
  3087. else
  3088. {
  3089. tagVal._time10 = _T("");
  3090. }
  3091. if( !pRSet->IsFieldNull(_T("authorize")) )
  3092. {
  3093. pRSet->GetFieldValue(_T("authorize"), vtFieldValue);
  3094. tagVal._authorize = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3095. }
  3096. else
  3097. {
  3098. tagVal._authorize = _T("");
  3099. }
  3100. if( !pRSet->IsFieldNull(_T("discount2")) )
  3101. {
  3102. pRSet->GetFieldValue(_T("discount2"), vtFieldValue);
  3103. tagVal._discount2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3104. }
  3105. else
  3106. {
  3107. tagVal._discount2 = _T("");
  3108. }
  3109. if( !pRSet->IsFieldNull(_T("authorize2")) )
  3110. {
  3111. pRSet->GetFieldValue(_T("authorize2"), vtFieldValue);
  3112. tagVal._authorize2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3113. }
  3114. else
  3115. {
  3116. tagVal._authorize2 = _T("");
  3117. }
  3118. if( !pRSet->IsFieldNull(_T("bz4")) )
  3119. {
  3120. pRSet->GetFieldValue(_T("bz4"), vtFieldValue);
  3121. tagVal._bz4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3122. }
  3123. else
  3124. {
  3125. tagVal._bz4 = _T("");
  3126. }
  3127. if( !pRSet->IsFieldNull(_T("satisfaction1")) )
  3128. {
  3129. pRSet->GetFieldValue(_T("satisfaction1"), vtFieldValue);
  3130. tagVal._satisfaction1 = vtFieldValue;
  3131. }
  3132. else
  3133. {
  3134. tagVal._satisfaction1 = 0;
  3135. }
  3136. if( !pRSet->IsFieldNull(_T("satisfaction2")) )
  3137. {
  3138. pRSet->GetFieldValue(_T("satisfaction2"), vtFieldValue);
  3139. tagVal._satisfaction2 = vtFieldValue;
  3140. }
  3141. else
  3142. {
  3143. tagVal._satisfaction2 = 0;
  3144. }
  3145. if( !pRSet->IsFieldNull(_T("satisfaction3")) )
  3146. {
  3147. pRSet->GetFieldValue(_T("satisfaction3"), vtFieldValue);
  3148. tagVal._satisfaction3 = vtFieldValue;
  3149. }
  3150. else
  3151. {
  3152. tagVal._satisfaction3 = 0;
  3153. }
  3154. if( !pRSet->IsFieldNull(_T("satisfaction4")) )
  3155. {
  3156. pRSet->GetFieldValue(_T("satisfaction4"), vtFieldValue);
  3157. tagVal._satisfaction4 = vtFieldValue;
  3158. }
  3159. else
  3160. {
  3161. tagVal._satisfaction4 = 0;
  3162. }
  3163. if( !pRSet->IsFieldNull(_T("satisfaction5")) )
  3164. {
  3165. pRSet->GetFieldValue(_T("satisfaction5"), vtFieldValue);
  3166. tagVal._satisfaction5 = vtFieldValue;
  3167. }
  3168. else
  3169. {
  3170. tagVal._satisfaction5 = 0;
  3171. }
  3172. if( !pRSet->IsFieldNull(_T("satisfaction6")) )
  3173. {
  3174. pRSet->GetFieldValue(_T("satisfaction6"), vtFieldValue);
  3175. tagVal._satisfaction6 = vtFieldValue;
  3176. }
  3177. else
  3178. {
  3179. tagVal._satisfaction6 = 0;
  3180. }
  3181. if( !pRSet->IsFieldNull(_T("satisfaction7")) )
  3182. {
  3183. pRSet->GetFieldValue(_T("satisfaction7"), vtFieldValue);
  3184. tagVal._satisfaction7 = vtFieldValue;
  3185. }
  3186. else
  3187. {
  3188. tagVal._satisfaction7 = 0;
  3189. }
  3190. if( !pRSet->IsFieldNull(_T("bz5")) )
  3191. {
  3192. pRSet->GetFieldValue(_T("bz5"), vtFieldValue);
  3193. tagVal._bz5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3194. }
  3195. else
  3196. {
  3197. tagVal._bz5 = _T("");
  3198. }
  3199. if( !pRSet->IsFieldNull(_T("send4")) )
  3200. {
  3201. pRSet->GetFieldValue(_T("send4"), vtFieldValue);
  3202. tagVal._send4 = vtFieldValue;
  3203. }
  3204. else
  3205. {
  3206. tagVal._send4 = 0;
  3207. }
  3208. if( !pRSet->IsFieldNull(_T("send5")) )
  3209. {
  3210. pRSet->GetFieldValue(_T("send5"), vtFieldValue);
  3211. tagVal._send5 = vtFieldValue;
  3212. }
  3213. else
  3214. {
  3215. tagVal._send5 = 0;
  3216. }
  3217. if( !pRSet->IsFieldNull(_T("waiter9")) )
  3218. {
  3219. pRSet->GetFieldValue(_T("waiter9"), vtFieldValue);
  3220. tagVal._waiter9 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3221. }
  3222. else
  3223. {
  3224. tagVal._waiter9 = _T("");
  3225. }
  3226. if( !pRSet->IsFieldNull(_T("curno")) )
  3227. {
  3228. pRSet->GetFieldValue(_T("curno"), vtFieldValue);
  3229. tagVal._curno = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3230. }
  3231. else
  3232. {
  3233. tagVal._curno = _T("");
  3234. }
  3235. if( !pRSet->IsFieldNull(_T("xplrr")) )
  3236. {
  3237. pRSet->GetFieldValue(_T("xplrr"), vtFieldValue);
  3238. tagVal._xplrr = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3239. }
  3240. else
  3241. {
  3242. tagVal._xplrr = _T("");
  3243. }
  3244. if( !pRSet->IsFieldNull(_T("xplrtime")) )
  3245. {
  3246. pRSet->GetFieldValue(_T("xplrtime"), vtFieldValue);
  3247. tagVal._xplrtime = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3248. }
  3249. else
  3250. {
  3251. tagVal._xplrtime = _T("");
  3252. }
  3253. if( !pRSet->IsFieldNull(_T("satisfaction8")) )
  3254. {
  3255. pRSet->GetFieldValue(_T("satisfaction8"), vtFieldValue);
  3256. tagVal._satisfaction8 = vtFieldValue;
  3257. }
  3258. else
  3259. {
  3260. tagVal._satisfaction8 = 0;
  3261. }
  3262. if( !pRSet->IsFieldNull(_T("VisitPeople1")) )
  3263. {
  3264. pRSet->GetFieldValue(_T("VisitPeople1"), vtFieldValue);
  3265. tagVal._visitpeople1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3266. }
  3267. else
  3268. {
  3269. tagVal._visitpeople1 = _T("");
  3270. }
  3271. if( !pRSet->IsFieldNull(_T("VisitPeople2")) )
  3272. {
  3273. pRSet->GetFieldValue(_T("VisitPeople2"), vtFieldValue);
  3274. tagVal._visitpeople2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3275. }
  3276. else
  3277. {
  3278. tagVal._visitpeople2 = _T("");
  3279. }
  3280. if( !pRSet->IsFieldNull(_T("VisitPeople3")) )
  3281. {
  3282. pRSet->GetFieldValue(_T("VisitPeople3"), vtFieldValue);
  3283. tagVal._visitpeople3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3284. }
  3285. else
  3286. {
  3287. tagVal._visitpeople3 = _T("");
  3288. }
  3289. if( !pRSet->IsFieldNull(_T("VisitPeople4")) )
  3290. {
  3291. pRSet->GetFieldValue(_T("VisitPeople4"), vtFieldValue);
  3292. tagVal._visitpeople4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3293. }
  3294. else
  3295. {
  3296. tagVal._visitpeople4 = _T("");
  3297. }
  3298. if( !pRSet->IsFieldNull(_T("VisitPeople5")) )
  3299. {
  3300. pRSet->GetFieldValue(_T("VisitPeople5"), vtFieldValue);
  3301. tagVal._visitpeople5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3302. }
  3303. else
  3304. {
  3305. tagVal._visitpeople5 = _T("");
  3306. }
  3307. if( !pRSet->IsFieldNull(_T("VisitPeople6")) )
  3308. {
  3309. pRSet->GetFieldValue(_T("VisitPeople6"), vtFieldValue);
  3310. tagVal._visitpeople6 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3311. }
  3312. else
  3313. {
  3314. tagVal._visitpeople6 = _T("");
  3315. }
  3316. if( !pRSet->IsFieldNull(_T("VisitPeople7")) )
  3317. {
  3318. pRSet->GetFieldValue(_T("VisitPeople7"), vtFieldValue);
  3319. tagVal._visitpeople7 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3320. }
  3321. else
  3322. {
  3323. tagVal._visitpeople7 = _T("");
  3324. }
  3325. if( !pRSet->IsFieldNull(_T("VisitPeople8")) )
  3326. {
  3327. pRSet->GetFieldValue(_T("VisitPeople8"), vtFieldValue);
  3328. tagVal._visitpeople8 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3329. }
  3330. else
  3331. {
  3332. tagVal._visitpeople8 = _T("");
  3333. }
  3334. if( !pRSet->IsFieldNull(_T("VisitTime1")) )
  3335. {
  3336. pRSet->GetFieldValue(_T("VisitTime1"), vtFieldValue);
  3337. tagVal._visittime1 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3338. }
  3339. else
  3340. {
  3341. tagVal._visittime1 = _T("");
  3342. }
  3343. if( !pRSet->IsFieldNull(_T("VisitTime2")) )
  3344. {
  3345. pRSet->GetFieldValue(_T("VisitTime2"), vtFieldValue);
  3346. tagVal._visittime2 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3347. }
  3348. else
  3349. {
  3350. tagVal._visittime2 = _T("");
  3351. }
  3352. if( !pRSet->IsFieldNull(_T("VisitTime3")) )
  3353. {
  3354. pRSet->GetFieldValue(_T("VisitTime3"), vtFieldValue);
  3355. tagVal._visittime3 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3356. }
  3357. else
  3358. {
  3359. tagVal._visittime3 = _T("");
  3360. }
  3361. if( !pRSet->IsFieldNull(_T("VisitTime4")) )
  3362. {
  3363. pRSet->GetFieldValue(_T("VisitTime4"), vtFieldValue);
  3364. tagVal._visittime4 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3365. }
  3366. else
  3367. {
  3368. tagVal._visittime4 = _T("");
  3369. }
  3370. if( !pRSet->IsFieldNull(_T("VisitTime5")) )
  3371. {
  3372. pRSet->GetFieldValue(_T("VisitTime5"), vtFieldValue);
  3373. tagVal._visittime5 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3374. }
  3375. else
  3376. {
  3377. tagVal._visittime5 = _T("");
  3378. }
  3379. if( !pRSet->IsFieldNull(_T("VisitTime6")) )
  3380. {
  3381. pRSet->GetFieldValue(_T("VisitTime6"), vtFieldValue);
  3382. tagVal._visittime6 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3383. }
  3384. else
  3385. {
  3386. tagVal._visittime6 = _T("");
  3387. }
  3388. if( !pRSet->IsFieldNull(_T("VisitTime7")) )
  3389. {
  3390. pRSet->GetFieldValue(_T("VisitTime7"), vtFieldValue);
  3391. tagVal._visittime7 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3392. }
  3393. else
  3394. {
  3395. tagVal._visittime7 = _T("");
  3396. }
  3397. if( !pRSet->IsFieldNull(_T("VisitTime8")) )
  3398. {
  3399. pRSet->GetFieldValue(_T("VisitTime8"), vtFieldValue);
  3400. tagVal._visittime8 = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3401. }
  3402. else
  3403. {
  3404. tagVal._visittime8 = _T("");
  3405. }
  3406. vtRet.push_back(tagVal);
  3407. pRSet->MoveNext();
  3408. }
  3409. DeleteADORecordSet(pRSet);
  3410. return nRecordCount;
  3411. }
  3412. int AdoImpl::GetTbl_IncrementalBackup_Values(IN CONST TCHAR *pTableName, IN CONST TCHAR *pFilters, IN CONST TCHAR *pSql, INT &nFieldCount, OUT vector<Tbl_IncrementalBackup>& vtRet)
  3413. {
  3414. TCHAR szSQL[1024] = _T("");
  3415. if(pFilters == NULL || _tcscmp(pFilters,_T("")) == 0)
  3416. _stprintf_s(szSQL,_T("select count(*) as cot from %s"),pTableName);
  3417. else
  3418. _stprintf_s(szSQL, _T("select count(*) as cot from %s where %s"), pTableName, pFilters);
  3419. int nRecordCount = 0;
  3420. _variant_t vtFieldValue;
  3421. BOOL bResult = FALSE;
  3422. EnterCriticalSection( &m_csAdo );
  3423. bResult = GetADODateBaseStatus();
  3424. if( FALSE == bResult )
  3425. {
  3426. LeaveCriticalSection( &m_csAdo );
  3427. return -1;
  3428. }
  3429. CADORecordset* pRSet = new CADORecordset(m_pADODatabase);
  3430. LeaveCriticalSection( &m_csAdo );
  3431. if( NULL == pRSet )
  3432. {
  3433. return -1;
  3434. }
  3435. bResult = OpenADORecordSet(pRSet, szSQL);
  3436. if( FALSE == bResult )
  3437. {
  3438. DeleteADORecordSet(pRSet);
  3439. return -1;
  3440. }
  3441. if( !pRSet->IsFieldNull(_T("cot")) )
  3442. {
  3443. pRSet->GetFieldValue(_T("cot"), nRecordCount);
  3444. }
  3445. else
  3446. {
  3447. nRecordCount = -1;
  3448. }// end if( !pRSet->IsFieldNull(0) )
  3449. DeleteADORecordSet(pRSet);
  3450. pRSet = new CADORecordset(m_pADODatabase);
  3451. LeaveCriticalSection( &m_csAdo );
  3452. if( NULL == pRSet )
  3453. {
  3454. return -1;
  3455. }
  3456. bResult = OpenADORecordSet(pRSet, pSql);
  3457. if( FALSE == bResult )
  3458. {
  3459. DeleteADORecordSet(pRSet);
  3460. return -1;
  3461. }
  3462. nFieldCount = pRSet->GetFieldCount();
  3463. for ( int i = 0; i < nRecordCount; i++)
  3464. {
  3465. Tbl_IncrementalBackup tagVal;
  3466. if( !pRSet->IsFieldNull(_T("isbackup")) )
  3467. {
  3468. pRSet->GetFieldValue(_T("isbackup"), vtFieldValue);
  3469. tagVal._isbackup = vtFieldValue;
  3470. }
  3471. else
  3472. {
  3473. tagVal._isbackup = false;
  3474. }
  3475. if( !pRSet->IsFieldNull(_T("branchid")) )
  3476. {
  3477. pRSet->GetFieldValue(_T("branchid"), vtFieldValue);
  3478. tagVal._branchid = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3479. }
  3480. else
  3481. {
  3482. tagVal._branchid = _T("");
  3483. }
  3484. if( !pRSet->IsFieldNull(_T("opttime")) )
  3485. {
  3486. pRSet->GetFieldValue(_T("opttime"), vtFieldValue);
  3487. tagVal._opttime = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3488. }
  3489. else
  3490. {
  3491. tagVal._opttime = _T("");
  3492. }
  3493. if( !pRSet->IsFieldNull(_T("order")) )
  3494. {
  3495. pRSet->GetFieldValue(_T("order"), vtFieldValue);
  3496. tagVal._order = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3497. }
  3498. else
  3499. {
  3500. tagVal._order = _T("");
  3501. }
  3502. if( !pRSet->IsFieldNull(_T("photoType")) )
  3503. {
  3504. pRSet->GetFieldValue(_T("photoType"), vtFieldValue);
  3505. tagVal._phototype = vtFieldValue;
  3506. }
  3507. else
  3508. {
  3509. tagVal._phototype = 0;
  3510. }
  3511. if( !pRSet->IsFieldNull(_T("content")) )
  3512. {
  3513. pRSet->GetFieldValue(_T("content"), vtFieldValue);
  3514. tagVal._content = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3515. }
  3516. else
  3517. {
  3518. tagVal._content = _T("");
  3519. }
  3520. if( !pRSet->IsFieldNull(_T("userid")) )
  3521. {
  3522. pRSet->GetFieldValue(_T("userid"), vtFieldValue);
  3523. tagVal._userid = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3524. }
  3525. else
  3526. {
  3527. tagVal._userid = _T("");
  3528. }
  3529. if( !pRSet->IsFieldNull(_T("username")) )
  3530. {
  3531. pRSet->GetFieldValue(_T("username"), vtFieldValue);
  3532. tagVal._username = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3533. }
  3534. else
  3535. {
  3536. tagVal._username = _T("");
  3537. }
  3538. if( !pRSet->IsFieldNull(_T("baktime")) )
  3539. {
  3540. pRSet->GetFieldValue(_T("baktime"), vtFieldValue);
  3541. tagVal._baktime = TString((TCHAR*)(_bstr_t)vtFieldValue);
  3542. }
  3543. else
  3544. {
  3545. tagVal._baktime = _T("");
  3546. }
  3547. vtRet.push_back(tagVal);
  3548. pRSet->MoveNext();
  3549. }
  3550. DeleteADORecordSet(pRSet);
  3551. return nRecordCount;
  3552. }