{"id":351,"date":"2013-09-27T14:28:24","date_gmt":"2013-09-27T06:28:24","guid":{"rendered":"http:\/\/blog.sorayuki.net\/?p=351"},"modified":"2013-09-27T14:28:24","modified_gmt":"2013-09-27T06:28:24","slug":"%e4%bd%bf%e7%94%a8ado%e8%ae%bf%e9%97%aeirowset%e7%9a%84%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/blog.sorayuki.net\/?p=351","title":{"rendered":"\u4f7f\u7528Ado\u8bbf\u95eeIRowset\u7684\u6570\u636e"},"content":{"rendered":"<p>\u6628\u5929\u4f7f\u7528OLEDB\u539f\u59cb\u7684\u65b9\u5f0f\u5217\u51fa\u4e86\u7cfb\u7edf\u91cc\u5b89\u88c5\u7684\u6240\u6709OLEDB Provider\uff0c\u8981\u7ed1\u5b9a\u554a\u5565\u7684\u5b9e\u5728\u5f88\u9ebb\u70e6\uff0c\u6240\u4ee5\u5c31\u60f3\u80fd\u4e0d\u80fd\u7528ADO\u6765\u641e\u3002\u6628\u5929\u5f04\u4e86\u4e00\u4e0b\u65e0\u679c\uff0c\u4eca\u5929\u63a5\u7740\uff0c\u628a\u5b83\u5f04\u51fa\u6765\u4e86\u3002 <\/p>\n<p><!--more--><\/p>\n<p>ADO\u6709\u4e00\u4e2aRowset\u5bf9\u8c61\uff0c\u770b\u8d77\u6765\u662f\u4e0d\u9700\u8981Binding\u53ef\u4ee5\u76f4\u63a5\u83b7\u53d6\u6570\u636e\u7684\u3002\u4e8e\u662f\u6628\u5929\u5c31\u627e\u554a\u627e\uff0c\u53d1\u73b0\u786e\u5b9e\u53ef\u4ee5\u4eceIRowset\u63a5\u53e3\u6784\u9020Recordset\u5bf9\u8c61\u7684\u3002\u4f46\u662f\u82e6\u4e8eMSDN\u4e0a\u5bf9\u4e8e\u8fd9\u65b9\u9762\u7684\u4ecb\u7ecd\uff0c\u53ea\u6709\u5173\u4e8e\u5bf9\u8c61\u7684\uff0c\u5374\u51e0\u4e4e\u6ca1\u6709\u5173\u4e8e\u5bf9\u8c61\u7c7b\u578b\u7684\u3002\u8fd9\u6837\u5b50\u7684\u8bdd\u6211\u80fd\u60f3\u5230\u7684\u5c31\u53ea\u80fd\u901a\u8fc7IDispatch\u6765\u8c03\u7528\u3002\u56e0\u4e3a\u4e0d\u592a\u60f3\u8fd9\u4e48\u505a\uff0c\u6240\u4ee5\u6700\u7ec8\u53bb\u770b\u4e86msado15.tlh\u5934\u6587\u4ef6\uff0c\u53d1\u73b0\u4e86\u70b9\u7ebf\u7d22\u3002<\/p>\n<p>Recordset\u5bf9\u8c61\u6709\u4e00\u4e2aRecordset\u7c7b\u578b\uff0c\u539f\u5148\u6211\u521b\u5efa\u5bf9\u8c61\u7684\u65f6\u5019\u7528\u7684\u662f<\/p>\n<pre class=\"prettyprint\">ADODB::Recordset* adoRecordset;\nCoCreateInstance(__uuidof(ADODB::Recordset), NULL, CLSCTX_INPROC_SERVER, __uuidof(ADODB::Recordset), (LPVOID*) &amp;adoRecordset);\n\n<\/pre>\n<p>\u4f46\u662f\u4e0d\u4ec5\u4ec5\u662f\u8fd9\u91cc\u5931\u8d25\uff0c\u8fde\u540e\u9762\u5728\u5b83\u4e0a\u9762\u7684\u51fd\u6570\u8c03\u7528\u90fd\u5931\u8d25\u3002\u51fd\u6570\u8c03\u7528\u7684\u5730\u65b9\u8bf4ADODB::Recordset\u662f\u4e0d\u5b8c\u6574\u7684\u7c7b\u578b\uff0c\u65e0\u6cd5\u5728\u4e0a\u9762\u8c03\u7528\u65b9\u6cd5\u3002\u770b\u5934\u6587\u4ef6\uff0c\u53d1\u73b0\u6709\u5b9a\u4e49\u7684\u662f\u4e00\u4e2a_Recordset\u7ed3\u6784\u4f53\u3002<strong>\u524d\u9762\u591a\u4e86\u4e2a\u4e0b\u5212\u7ebf<\/strong>\u3002\u597d\u5427\u65e2\u7136\u8fd9\u6837\u90a3\u6211\u5c31<\/p>\n<p><pre class=\"prettyprint\">ADODB::_Recordset* adoRecordset;\nCoCreateInstance(__uuidof(ADODB::_Recordset), NULL, CLSCTX_INPROC_SERVER, __uuidof(ADODB::_Recordset), (LPVOID*) &amp;adoRecordset);\n\n<\/pre>\n<\/p>\n<p>\u867d\u7136\u7f16\u8bd1\u901a\u8fc7\u4e86\uff0c\u4f46\u662f\u8fd9\u4e2aCoCreateInstance\u534e\u4e3d\u4e3d\u5730\u8fd4\u56de\u4e86REGDB_E_CLASSNOTREG\u3002\u770b\u6765\u7c7b\u8fd8\u662f\u8981\u7528\u6ca1\u6709\u4e0b\u5212\u7ebf\u90a3\u4e2a\uff0c\u6bd5\u7adfMSDN\u91cc\u540d\u5b57\u6ca1\u6709\u4e0b\u5212\u7ebf\u2026\u2026\u3002\u6574\u4e86\u6574\uff0c\u53d8\u6210\u4e0b\u9762\u8fd9\u6837\uff0c\u53ef\u4ee5\u6210\u529f\u521b\u5efa\u5bf9\u8c61\u4e86<\/p>\n<p><pre class=\"prettyprint\">ADODB::_Recordset* adoRecordset;\nCoCreateInstance(__uuidof(ADODB::Recordset), NULL, CLSCTX_INPROC_SERVER, __uuidof(ADODB::_Recordset), (LPVOID*) &amp;adoRecordset);\n\n<\/pre>\n<\/p>\n<p>\uff08P.S. \u540e\u6765\u53d1\u73b0\u770b\u5934\u6587\u4ef6\u7684\u8bdd\uff0c\u53ef\u4ee5\u770b\u51fa<strong>Recordset\u6709\u6ce8\u91caCoclass<\/strong>\uff0c\u800c<strong>_Recordset\u6ce8\u91ca\u662finterface<\/strong>\uff09<\/p>\n<p>\u7136\u540e\u63a5\u4e0b\u6765\uff0c\u8981\u7528ADORecordsetConstruction\u63a5\u53e3\u91cc\u7684Rowset\u5c5e\u6027\u6765\u628aIRowset\u63a5\u53e3\u7684\u6570\u636e\u5bf9\u8c61\u585e\u8fdb\u53bb\u3002\u5c31\u76f4\u63a5\u8c03\u7528QueryInterface\u7136\u540eput_Rowset\uff0c\u8fd9\u5012\u662f\u5f88\u987a\u5229<\/p>\n<p><pre class=\"prettyprint\">ADODB::ADORecordsetConstruction* adoRecordsetContructor;\nadoRecordset-&gt;QueryInterface(__uuidof(ADODB::ADORecordsetConstruction), (LPVOID*) &amp;adoRecordsetContructor);\nadoRecordsetContructor-&gt;put_Rowset(pRowset);\nadoRecordsetContructor-&gt;Release();\n\n<\/pre>\n<\/p>\n<p>\u5f80\u540e\u67e5\u770bRecordset\u5bf9\u8c61\u7684\u65b9\u6cd5\u96c6\uff0c\u4e00\u773c\u770b\u5230\u5bf9\u6211\u6709\u7528\u7684\u5c31\u662fMoveNext\u548cGetRows\uff0c\u8fd8\u6709EOF\u5c5e\u6027\uff08\u6ce8\uff1a\u8fd9\u4e2aEOF\u5c5e\u6027\u5728\u5bfc\u5165DLL\u751f\u6210TLH\u6587\u4ef6\u7684\u65f6\u5019\u8981\u91cd\u65b0\u547d\u540d\u4e00\u4e0b\uff0c\u4e0d\u7136\u4f1a\u62a5\u9519\uff09\u3002\u8fd9\u4e2aGetRows\u597d\u773c\u719f\uff0c\u5c31\u662f\u6628\u5929OLEDB\u91cc\u62ff\u5230\u4e00\u5806HROW\u7136\u540e\u53ef\u4ee5\u83b7\u53d6\u6570\u636e\u7684\u90a3\u4e2a\u3002\u90a3\u4e48\u770b\u540d\u5b57\uff0c\u5b83\u662f\u8981\u6211\u8c03\u7528MoveNext\u7136\u540e\u68c0\u67e5EOF\u7136\u540e\u83b7\u53d6\u6570\u636e\uff0c\u4e4b\u540e\u5faa\u73af\u54af\uff1fMoveNext\u770b\u5b83\u7684\u8bf4\u660e\u662f\u6ca1\u6709\u53c2\u6570\u3002EOF\u662fVARIANT_BOOL\u578b\uff0c\u8fd9\u79cd\u7c7b\u578b\u8fd8\u6709\u70b9\u90a3\u5565\u90a3\u5565\u5565\u56e0\u4e3a\u5b83\u7684\u5b9a\u4e49\u662fTRUE\u7684\u65f6\u50190xFFFF\u3001FALSE\u7684\u65f6\u50190\uff0c<strong>\u6211\u5728\u5b9e\u9645\u64cd\u4f5c\u7684\u65f6\u5019\u548c0xFFFF\u6bd4\u8f83\u4f3c\u4e4e\u8fd8\u6bd4\u4e0d\u51fa\u6765<\/strong>\uff0c\u5927\u6982\u662f\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u6837\uff08\u76f4\u63a5\u51990xFFFF\u9ed8\u8ba4\u662f32\u4f4d\u800cVARIANT_BOOL\u662f16\u4f4d\uff0c\u8f6c\u6362\u7684\u65f6\u5019\u54ea\u91cc\u9519\u4e86\u53ef\u80fd\uff09\u3002\u7136\u540e\u9ebb\u70e6\u7684\u662fGetRows\uff0cMSDN\u91cc\u6ca1\u6709\u7ed9\u51fa\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u5c31\u8bf4\u5230\u8fd4\u56de\u7684\u662f\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\u3002\u53c2\u6570\u7684\u8bdd\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u81f3\u4eca\u6ca1\u660e\u767d\uff0c\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u5c31\u662f\u9001\u4e00\u4e2aVARIANT\u578b\u7684\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4\u8fdb\u53bb\uff0c\u6307\u660e\u8981\u8fd4\u56de\u4ec0\u4e48\u5217\u3002\u8fd9\u8fd4\u56de\u503c\u5c31\u662f\u4e0d\u77e5\u9053\u662f\u600e\u4e48\u56de\u4e8b\uff0c\u8fd9\u79cd\u53c2\u8003\u770b\u7684\u771f\u7684\u5404\u79cd\u75db\u82e6\uff0c\u4e8e\u662f\u770b\u5b83\u4f8b\u5b50\uff0c\u4f8b\u5b50\u91cc\u8d6b\u7136\u662f_variant_t\uff08\u5176\u5b9e\u540e\u6765\u53d1\u73b0\uff0c<strong>\u770b\u5934\u6587\u4ef6\u5c31\u77e5\u9053\u662f\u8fd9\u4e2a\u7c7b\u578b<\/strong>\u4e86\u2026\u2026\u4f46\u662f\u4e0d\u600e\u4e48\u60f3\u7ffb\u5934\u6587\u4ef6\u554aorz\uff09\u3002<\/p>\n<p>\u6839\u636e\u7814\u7a76\uff0cGetRows\u8fd4\u56de\u7684\u6570\u7ec4\u5927\u6982\u957f\u8fd9\u6837\uff1a<\/p>\n<table cellspacing=\"1\" cellpadding=\"2\" width=\"574\" border=\"3\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"180\">[0][0] \u8bb0\u5f551\uff0c\u5b57\u6bb51<\/td>\n<td valign=\"top\" width=\"217\">[0][1] \u8bb0\u5f552\uff0c\u5b57\u6bb51<\/td>\n<td valign=\"top\" width=\"167\">[0][2] \u8bb0\u5f553\uff0c\u5b57\u6bb51<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"180\">[1][0] \u8bb0\u5f551\uff0c\u5b57\u6bb52<\/td>\n<td valign=\"top\" width=\"217\">[1][1] \u8bb0\u5f552\uff0c\u5b57\u6bb52<\/td>\n<td valign=\"top\" width=\"170\">[1][2] \u8bb0\u5f553\uff0c\u5b57\u6bb52<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"180\">[2][0] \u8bb0\u5f551\uff0c\u5b57\u6bb53<\/td>\n<td valign=\"top\" width=\"217\">[2][1] \u8bb0\u5f551\uff0c\u5b57\u6bb53<\/td>\n<td valign=\"top\" width=\"172\">[2][2] \u8bb0\u5f553\uff0c\u5b57\u6bb53<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"180\">\u2026<\/td>\n<td valign=\"top\" width=\"217\">\u2026<\/td>\n<td valign=\"top\" width=\"172\">\u2026<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e48\u753b\u51fa\u6765\uff0c\u603b\u89c9\u5f97\u54ea\u91cc\u5fae\u5999\u5730\u6709\u70b9\u4e0d\u4e60\u60ef\u2026\u2026\u600e\u4e48\u4e0d\u662f\u4e00\u884c\u4e00\u4e2a\u8bb0\u5f55\u800c\u662f\u4e00\u5217\u4e00\u4e2a\u8bb0\u5f55\u3002<\/p>\n<p>\u4e8e\u662f\u4e4e\uff0c\u8f93\u51fa\u6570\u636e\u5c31\u6709\u4e86\u8fd9\u6837\u5b50\u7684\u4ee3\u7801\uff08EOF\u6211\u91cd\u547d\u540d\u4e3aadoEOF\u4e86\uff09<\/p>\n<pre class=\"prettyprint\">adoRecordset-&gt;MoveNext();\nfor(;;) {\n    VARIANT_BOOL vbEof;\n    adoRecordset-&gt;get_adoEOF(&amp;vbEof);\n    if (vbEof != FALSE) break;\n\n    VARIANT data;\n            \n    data = adoRecordset-&gt;GetRows(1);\n\n    LONG nIndexes[2];\n    nIndexes[0] = 0;\n    nIndexes[1] = 0;\n\n    VARIANT result;\n    result.vt = VT_BSTR;\n\n    SafeArrayGetElement(data.parray, nIndexes, &amp;result);\n    wprintf(L\"%s\\n\", result.bstrVal);\n\n    nIndexes[0] = 2;\n\n    SafeArrayGetElement(data.parray, nIndexes, &amp;result);\n    wprintf(L\"%s\\n\\n\", result.bstrVal);\n\n    VariantClear(&amp;result);\n    VariantClear(&amp;data);\n\n    adoRecordset-&gt;MoveNext();\n}\n\n<\/pre>\n<p>\u7ed3\u679c\u5c31\u662f\uff0c\u5d29\u3002\u5355\u6b65\u8ddf\u8e2a\uff0c\u53d1\u73b0GetRows\u8c03\u7528\u5b8c\u4e4b\u540e\uff0cdata\u91cc\u53ef\u4ee5\u83b7\u53d6\u5230\u7c7b\u578b\u662f\u6570\u7ec4\uff0c\u4f46\u662f\u5374\u6ca1\u6709\u6570\u636e\u3002\u8fd9\u975e\u5e38\u8be1\u5f02\uff0c\u4ed4\u7ec6\u5bf9\u6bd4MSDN\u7ed9\u7684\u4f8b\u5b50\uff0c\u5bf9\u6bd4\u51fa\u6765\u53d1\u73b0\u5b83\u7528\u7684\u7c7b\u578b_variant_t\u548c\u6211\u5199VARIANT\u4e0d\u540c\u3002\u6211\u89c9\u5f97\u8fd9\u4e24\u4e2a\u662f\u4e00\u6837\u7684\u4e1c\u897f\u554a\uff0c\u4f46\u662f\u4e3a\u4ec0\u4e48\u6211\u6539\u6210_variant_t\u4ee5\u540e\u5c31\u53ef\u4ee5\u4e86\u5462\u3002\u53bb\u67e5_variant_t\u7684\u5b9a\u4e49\uff0c\u53d1\u73b0\u4e86\u6211\u88ab\u5751\u7684\u5730\u65b9\uff0c\u5728comutil.h\u4e2d\u6709\u8fd9\u6837\u7684\u4ee3\u7801<\/p>\n<pre class=\"prettyprint\">inline _variant_t::~_variant_t() throw()\n{\n    ::VariantClear(this);\n}\n\n<\/pre>\n<p>\u800cGetRows\u7684\u8fd4\u56de\u7c7b\u578b\u53c8\u662f_variant_t\uff0c\u6240\u4ee5<strong>\u6211\u7684VARIANT\u5176\u5b9e\u83b7\u53d6\u5230\u7684\u662f\u4e00\u4e2a\u5df2\u7ecf\u6790\u6784\u4e86\u7684_variant_t\u7684\u5185\u90e8\u6570\u636e<\/strong>\uff08\u597d\u4e86\u561b\uff0c\u6211\u53ea\u662f\u60f3\u8bd5\u7740\u7528\u4e00\u4e0b\u3001\u7406\u89e3\u4e00\u4e0b\u5b83\u7684\u539f\u59cb\u63a5\u53e3\uff0c\u7136\u540e\u518d\u63a5\u89e6\u8fd9\u4e9butil\u4f1a\u638c\u63e1\u5f97\u6bd4\u8f83\u597d\u800c\u5df2\u4e86\u5566\uff1e\uff1c\uff09\u3002<\/p>\n<p>\u77e5\u9053\u4e86\u8fd9\u4e2a\u95ee\u9898\u4ee5\u540e\uff0c\u5c31<strong>\u628aGetRows(1)\u6539\u6210GetRows(1).Detach()<\/strong>\u4e86\uff08\u6b7b\u4e0d\u6094\u6539\uff08\u6bb4<\/p>\n<p><pre class=\"prettyprint\">data = adoRecordset-&gt;GetRows(1).Detach();\n\n<\/pre>\n<\/p>\n<p>\u8fd9\u4e0b\u7a0b\u5e8f\u53ef\u4ee5\u8fd0\u884c\u4e86\uff0c\u4f46\u662f\u8f93\u51fa\u7684\u8fd8\u662f\u4e0d\u5bf9\u3002\u5230\u5e95\u662f\u54ea\u91cc\u4e0d\u5bf9\u5462\uff0c\u597d\u50cf\u6bd4\u5176\u4ed6\u5730\u65b9\u5c11\u4e86\u4e0d\u5c11\uff0c\u5927\u6982\u6709\u4e00\u534a\u7684\u6837\u5b50\u3002\u662f\u4e0d\u662f\u548cADO.net\u4e0d\u4e00\u6837\uff0c\u4e00\u5f00\u59cb\u4e0d\u9700\u8981DataReader.Read\u4e00\u4e0b\u5462\uff0c\u6211\u5c31\u628afor\u524d\u9762\u7684\u90a3\u4e2aMoveNext\u7ed9\u5220\u4e86\uff0c\u8fd0\u884c\uff0c\u5d29\uff0c\u5d29\u5728MoveNext\u3002<\/p>\n<p>\u6309\u7406\u6765\u8bf4\u6211\u90fd\u6709\u68c0\u67e5EOF\uff0c\u4e0d\u4f1a\u51fa\u73b0\u5230\u5c3e\u7aef\u4e86\u8fd8\u5728\u7ee7\u7eedMoveNext\u7684\u95ee\u9898\u624d\u5bf9\u3002\u56de\u60f3\u8d77OLEDB\u91ccGetNextRows\u7684\u64cd\u4f5c\uff0c\u597d\u50cf\u53ea\u6709GetNextRows\u800c\u6ca1\u6709MoveNext\uff1f\u4e8e\u662f\u5176\u5b9e\u4e0d\u9700\u8981MoveNext\u624d\u662f\u5bf9\u7684\uff1f\u90a3\u6211\u5c31\u5148<strong>\u628aMoveNext\u53bb\u6389<\/strong>\uff0c\u770b\u770b\u4f1a\u4e0d\u4f1a\u6b7b\u5faa\u73af\u5427\u3002<\/p>\n<p>\u7136\u540e\u7ed3\u679c\u662f\u4e0d\u6b7b\u5faa\u73af\uff0c\u83b7\u53d6\u6570\u636e\u4e00\u5207\u6b63\u5e38\uff0c\u56e7\u3002<\/p>\n<p>\u867d\u7136\u603b\u89c9\u5f97\u8fd8\u662f\u7565\u9ebb\u70e6\uff0c\u4e0d\u8fc7\u4e0d\u77e5\u9053\u76f8\u5bf9\u4e8eOLEDB\u6765\u8bf4\u662f\u4e0d\u662f\u5df2\u7ecf\u7b80\u5355\u4e0d\u5c11\u4e86\uff1f\u5bf9\u6bd4\u4e00\u4e0b\uff0c\u5a18\u7684\uff0c\u7a0b\u5e8f\u4ee3\u7801\u7684\u884c\u6570\u4f3c\u4e4e\u6ca1\u89c1\u5f97\u6709\u4ec0\u4e48\u53d8\u5c11 \u2013_,\u2013<\/p>\n<p>\u4e3a\u4e86\u5c1d\u8bd5\u4e00\u4e0bMoveNext\uff0c\u53c8\u6539\u4e86\u6539\u4ee3\u7801\uff0c\u6539\u4e3a\u76f4\u63a5\u4eceRecordset\u7684Fields\u5c5e\u6027\u91cc\u62ff\u6570\u636e\uff0c\u800c\u4e0d\u662fGetRows\u3002\u8bd5\u8fc7\u4e86\u6ee1\u8db3\u4e86\u603b\u4e4b\u7565\u9ebb\u70e6<\/p>\n<pre class=\"prettyprint\">for(;;) { \/\/0xffff is true\n\tVARIANT_BOOL vbEof;\n\tadoRecordset-&gt;get_adoEOF(&amp;vbEof);\n\tif (vbEof != FALSE) break;\n\n\tVARIANT data;\n            \n\tADODB::Fields* fields;\n\tADODB::Field *f1, *f2;\n\tadoRecordset-&gt;get_Fields(&amp;fields);\n\tVARIANT nIndex;\n\tVariantInit(&amp;nIndex);\n\tnIndex.vt = VT_I2;\n\tnIndex.intVal = 0;\n\tfields-&gt;get_Item(nIndex, &amp;f1);\n\tnIndex.intVal = 2;\n\tfields-&gt;get_Item(nIndex, &amp;f2);\n\tfields-&gt;Release();\n\tVariantClear(&amp;nIndex);\n\n\tVARIANT val1, val2;\n\tVariantInit(&amp;val1);\n\tVariantInit(&amp;val2);\n\tf1-&gt;get_Value(&amp;val1);\n\tf2-&gt;get_Value(&amp;val2);\n\n\tf1-&gt;Release();\n\tf2-&gt;Release();\n\n\twprintf(L\"%s\\n\", val1.bstrVal);\n\twprintf(L\"%s\\n\\n\", val2.bstrVal);\n\n\tVariantClear(&amp;val1);\n\tVariantClear(&amp;val2);\n\n\tadoRecordset-&gt;MoveNext();\n}\n\n<\/pre>\n<p>\u4e3a\u4ec0\u4e48VARIANT\u7684\u7c7b\u578b\u662fI2\u800c\u4e0d\u662fI4\uff1fsa\uff0c\u6211\u7528I4\u5b83\u5c31\u4e0d\u8ba4\uff0c\u540e\u9762\u770b\u4e86MSDN\u7684\u4f8b\u5b50\u624d\u77e5\u9053\u662fI2\u3002MSDN\u91cc\u5bf9\u4e8e\u8fd9\u4e00\u5757\u7684\u89e3\u91ca\u5b9e\u5728\u662f\u4e0d\u591f\u8be6\u7ec6\u554a\uff0c\u81f3\u5c11\u6ca1\u6709Kernel32.dll\u91cc\u9762\u5927\u90e8\u5206API\u8bb2\u5f97\u90a3\u4e48\u8be6\u7ec6\u3002<\/p>\n<p>\u4f7f\u7528MoveNext\u548c\u4f7f\u7528GetRows\u7684\u4ee3\u7801\u90fd\u653e\u4e0a\u6765\u4e86<\/p>\n<div id=\"scid:F60BB8FA-6F02-4999-8F5E-9DD4E92C4DA7:29432102-bc97-49c0-af0f-311c3656e399\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<div><a href=\"https:\/\/blog.sorayuki.net\/wp-content\/uploads\/2013\/09\/enumOledbProvider_ADO.zip\" target=\"_blank\">\u70b9\u4e86\u53ef\u4ee5\u4e0b\u8f7d<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u5929\u4f7f\u7528OLEDB\u539f\u59cb\u7684\u65b9\u5f0f\u5217\u51fa\u4e86\u7cfb\u7edf\u91cc\u5b89\u88c5\u7684\u6240\u6709OLEDB Provider\uff0c\u8981\u7ed1\u5b9a\u554a\u5565\u7684\u5b9e\u5728\u5f88\u9ebb\u70e6\uff0c\u6240\u4ee5\u5c31 &hellip; <a href=\"https:\/\/blog.sorayuki.net\/?p=351\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u4f7f\u7528Ado\u8bbf\u95eeIRowset\u7684\u6570\u636e<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-windows"],"_links":{"self":[{"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=351"}],"version-history":[{"count":0,"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=\/wp\/v2\/posts\/351\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sorayuki.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}