{"id":2144,"date":"2015-03-17T20:59:25","date_gmt":"2015-03-17T12:59:25","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=2144"},"modified":"2015-03-17T21:36:15","modified_gmt":"2015-03-17T13:36:15","slug":"qdataset-%e5%85%8b%e9%9a%86%e5%92%8c%e5%a4%8d%e5%88%b6%e6%95%b0%e6%8d%ae%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=2144","title":{"rendered":"QDataSet &#8211; \u514b\u9686\u548c\u590d\u5236\u6570\u636e\u8be6\u89e3"},"content":{"rendered":"<p>QDataSet \u63d0\u4f9b\u4e86\u514b\u9686\uff08 Clone \uff09 \u548c \u590d\u5236 \uff08CopyFrom\uff09 \u00a0\u4e24\u4e2a\u65b9\u6cd5\u6765\u4ece\u53e6\u4e00\u4e2a\u6570\u636e\u96c6\u4e2d\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u96c6\u5185\u5bb9\u7684\u62f7\u8d1d\u3002\u4f46 Clone \u548c CopyFrom \u65b9\u6cd5\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\uff1a<\/p>\n<ul>\n<li>Clone \u662f\u521b\u5efa\u4e86\u4e00\u4e2a\u5bf9\u6e90\u6570\u636e\u96c6\u7684\u5f15\u7528\uff0c\u514b\u9686\u5b9e\u9645\u4e0a\u76f8\u5f53\u4e8e\u521b\u5efa\u4e86\u4e00\u7ec4\u65b0\u7684\u6e38\u6807\uff0c\u6765\u6307\u5411\u539f\u6765\u7684\u6570\u636e\u96c6\uff0c\u60a8\u53ef\u4ee5\u5bf9\u8fd9\u4e2a\u514b\u9686\u540e\u7684\u6570\u636e\u96c6\u8fdb\u884c\u8fc7\u6ee4\u3001\u6392\u5e8f\u7b49\u5404\u79cd\u5904\u7406\uff0c\u4f46\u4f60\u5982\u679c\u5bf9\u5176\u4e2d\u4efb\u610f\u4e00\u4e2a\u6570\u636e\u96c6\u7684\u6570\u636e\u8fdb\u884c\u4e86\u4fee\u6539\uff0c\u5219\u53d8\u52a8\u4f1a\u540c\u6b65\u53cd\u9988\u5230\u53e6\u4e00\u4e2a\u6570\u636e\u96c6\u3002\u7b80\u8a00\u4e4b\uff0c\u514b\u9686\u51fa\u6765\u7684\u6570\u636e\u96c6\u5185\u5bb9\u548c\u514b\u9686\u6e90\u5b8c\u5168\u540c\u6b65\uff0c\u4e0d\u540c\u7684\u662f\u514b\u9686\u51fa\u6765\u7684\u6570\u636e\u96c6\u53ef\u4ee5\u8fdb\u884c\u72ec\u7acb\u7684\u8fc7\u6ee4\u3001\u6392\u5e8f\u7b49\u5904\u7406\uff0c\u800c\u4e0d\u4f1a\u5bf9\u514b\u9686\u6e90\u4ea7\u751f\u5f71\u54cd\u3002<\/li>\n<li>CopyFrom \u662f\u521b\u5efa\u4e86\u4e00\u4e2a\u6e90\u6570\u636e\u96c6\u5185\u5bb9\u7684\u62f7\u8d1d\u5b9e\u4f8b\uff0c\u5bf9\u62f7\u8d1d\u5b9e\u4f8b\u7684\u589e\u5220\u6539\u90fd\u4e0d\u4f1a\u5730\u6e90\u6570\u636e\u96c6\u4ea7\u751f\u4efb\u4f55\u5f71\u54cd\u3002\u62f7\u8d1d\u540e\u7684\u5b9e\u4f8b\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u589e\u5220\u67e5\u6539\uff0c\u800c\u8fd9\u4e9b\u53d8\u52a8\u4e0d\u4f1a\u53cd\u9988\u5230\u6e90\u6570\u636e\u96c6\u3002CopyFrom \u51fd\u6570\u652f\u6301\u591a\u79cd\u590d\u5236\u65b9\u5f0f\uff0c\u66f4\u7075\u6d3b\u3002<\/li>\n<\/ul>\n<p>\u6211\u4eec\u6765\u770b\u4e0b\u514b\u9686\u548c\u590d\u5236\u76f8\u5173\u7684\u51fd\u6570\u58f0\u660e\uff1a<\/p>\n<pre class=\"lang:delphi decode:true\">    \/\/\/ &lt;summary&gt; \u4ece\u6e90\u6570\u636e\u96c6\u514b\u9686\u4e00\u4e2a\u65b0\u5b9e\u4f8b &lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"ASource\"&gt;\u514b\u9686\u7684\u6e90\u6570\u636e\u96c6&lt;\/param&gt;\r\n    procedure Clone(ASource: TQDataSet);\r\n    \/\/\/ &lt;summary&gt; \u65ad\u5f00\u4e0e\u514b\u9686\u6e90\u6570\u636e\u96c6\u7684\u94fe\u63a5&lt;\/summay&gt;\r\n    \/\/\/ &lt;remarks&gt;\u65ad\u5f00\u8fde\u63a5\u540e\uff0c\u6570\u636e\u96c6\u7684\u53d8\u66f4\u4e0d\u4f1a\u518d\u53cd\u9988\u5230\u514b\u9686\u6e90\u53ca\u5176\u5b83\u514b\u9686\u6570\u636e\u96c6&lt;\/remarks&gt;\r\n    procedure Unlink;\r\n    \/\/\/ &lt;summary&gt; \u4ece\u6e90\u6570\u636e\u96c6\u62f7\u8d1d\u4e00\u4e2a\u65b0\u5b9e\u4f8b&lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"ASource\"&gt; \u6e90\u6570\u636e\u96c6 &lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AMethod\"&gt; \u590d\u5236\u65b9\u5f0f&lt;\/param&gt;\r\n    procedure CopyFrom(ASource: TQDataSet; AMethod: TQDataCopySource); overload;\r\n    \/\/\/ &lt;summary&gt; \u4ece\u6e90\u6570\u636e\u96c6\u62f7\u8d1d\u4e00\u4e2a\u65b0\u5b9e\u4f8b&lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"ASource\"&gt; \u6e90\u6570\u636e\u96c6 &lt;\/param&gt;\r\n    procedure CopyFrom(ASource: TDataSet); overload;\r\n<\/pre>\n<p>1\u3001Clone<\/p>\n<p>\u6b64\u51fd\u6570\u552f\u4e00\u7684\u662f\u53c2\u6570\u662f\u6e90\u6570\u636e\u96c6\u5bf9\u8c61\u3002<\/p>\n<p>2\u3001Unlink<\/p>\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u514b\u9686\u6765\u7684\u6570\u636e\u96c6\uff0c\u6b64\u51fd\u6570\u7528\u4e8e\u5f3a\u5236\u65ad\u5f00\u4e0e\u6e90\u6570\u636e\u96c6\u7684\u94fe\u63a5\u3002 Unlink \u4f1a\u5c06\u6e90\u6570\u636e\u96c6\u8fdb\u884c\u4e00\u4e2a\u5185\u5bb9\u7684\u62f7\u8d1d\uff0c\u4ee5\u4fbf\u4fdd\u8bc1\u5728\u65ad\u5f00\u94fe\u63a5\u540e\u4f9d\u7136\u80fd\u591f\u6b63\u5e38\u5de5\u4f5c\u3002\u65ad\u5f00\u540e\u7684\u6570\u636e\u96c6\u4e0d\u4f1a\u518d\u4e0e\u514b\u9686\u6e90\u4e4b\u95f4\u540c\u6b65\u72b6\u6001\u53d8\u66f4\u3002<\/p>\n<p>3\u3001CopyFrom<\/p>\n<p>CopyFrom \u6709\u4e24\u4e2a\u91cd\u8f7d\uff0c\u4e00\u4e2a\u662f\u4ece\u666e\u901a\u7684\u6570\u636e\u96c6\u6765\u590d\u5236\u5185\u5bb9\uff0c\u53e6\u4e00\u4e2a\u662f\u4ece\u4e00\u4e2aTQDataSet \u7c7b\u5f04\u7684\u6e90\u6570\u636e\u96c6\u4e2d\u590d\u5236\u5185\u5bb9\u3002\u6211\u4eec\u4e3b\u8981\u8bf4\u660e\u540e\u4e00\u4e2a\u65b9\u6cd5\u4e2d\u7684AMethod\u53c2\u6570\uff1a<\/p>\n<ul>\n<li>dcmUnknown : \u5728\u590d\u5236\u65f6\u7b49\u4ef7\u4e8e dcmView<\/li>\n<li>dcmView : \u5982\u679c\u662f\u5206\u9875\u6a21\u5f0f\u4e0b\uff0c\u5219\u4ec5\u590d\u5236\u5f53\u524d\u5206\u9875\u5185\u7684\u6570\u636e\uff0c\u5426\u5219\uff0c\u590d\u5236\u5f53\u524d\u663e\u793a\u8303\u56f4\u5185\u7684\u6570\u636e<\/li>\n<li>dcmCurrents : \u590d\u5236\u6570\u636e\u96c6\u5185\u6240\u6709\u5185\u5bb9\u7684\u5f53\u524d\u72b6\u6001<\/li>\n<li>dcmOrigins : \u590d\u5236\u6570\u636e\u96c6\u5185\u6240\u6709\u5185\u5bb9\u7684\u539f\u59cb\u6570\u636e\uff08\u672a\u4fee\u6539\u6216\u5220\u9664\u524d\u7684\u8bb0\u5f55\uff09\uff0c\u6ce8\u610f\u5220\u9664\u7684\u6570\u636e\u4f1a\u4f4d\u4e8e\u590d\u5236\u540e\u7684\u6570\u636e\u96c6\u5c3e\u90e8\uff08\u56e0\u4e3a\u539f\u59cb\u7684\u4f4d\u7f6e\u4fe1\u606f\u5728\u5220\u9664\u65f6\u4f1a\u4e22\u5931\uff0c\u6240\u4ee5\u6682\u65f6\u4e0d\u652f\u6301\u6062\u590d\uff09<\/li>\n<li>dcmInserted : \u53ea\u590d\u5236\u53d8\u66f4\u5185\u5bb9\u4e2d\u65b0\u63d2\u5165\u7684\u6570\u636e<\/li>\n<li>dcmDeleted : \u53ea\u590d\u5236\u53d8\u66f4\u5185\u5bb9\u4e2d\u5df2\u5220\u9664\u7684\u6570\u636e<\/li>\n<li>dcmModified : \u53ea\u590d\u5236\u53d8\u66f4\u5185\u5bb9\u4e2d\u5df2\u4fee\u6539\u7684\u6570\u636e<\/li>\n<li>dcmChanged : \u590d\u5236\u6240\u6709\u7684\u53d8\u66f4\u5185\u5bb9<\/li>\n<li>dcmSorted : \u6309\u5f53\u524d\u6392\u5e8f\u7684\u7ed3\u679c\u590d\u5236\u5df2\u6392\u5e8f\u7684\u6570\u636e<\/li>\n<li>dcmFiltered : \u6309\u5f53\u524d\u8fc7\u6ee4\u7684\u7ed3\u679c\u590d\u5236\u5df2\u8fc7\u6ee4\u7684\u6570\u636e<\/li>\n<li>dcmMetaOnly :\u53ea\u590d\u5236\u6570\u636e\u96c6\u5b9a\u4e49\uff0c\u4e0d\u590d\u5236\u6570\u636e\u5185\u5bb9<\/li>\n<\/ul>\n<p>\u4ece\u666e\u901a\u7684\u6570\u636e\u96c6\u53c2\u6570\u590d\u5236\u5185\u5bb9\u65f6\uff0c\u5176\u64cd\u4f5c\u7b49\u4ef7\u4e8e dcmView\uff0c\u53ea\u590d\u5236\u6e90\u6570\u636e\u96c6\u4e2d\u5f53\u524d\u663e\u793a\u8303\u56f4\u5185\u7684\u5185\u5bb9\u3002\u4e0b\u56fe\u662f Demos\\Delphi\\VCL\\QDB\\Copy \u6f14\u793a\u7a0b\u5e8f\u7684\u5b9e\u9645\u8fd0\u884c\u6548\u679c\uff0c\u5176\u4e2d\u524d50\u6761\u8bb0\u5f55\u88ab\u6807\u8bb0\u4e3a usUnmodified\uff0c51 \u5f00\u59cb\u768450\u6761\u8bb0\u5f55\u88ab\u6807\u8bb0\u4e3a usModified\uff0c101 \u548c 102 \u4e24\u6761\u8bb0\u5f55\u88ab\u5220\u9664\u4ee5\u4fbf\u88ab\u6807\u8bb0\u4e3a usDeleted\u3002<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/03\/DSCopy.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2145\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/03\/DSCopy.gif\" alt=\"DSCopy\" width=\"729\" height=\"443\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>QDataSet \u63d0\u4f9b\u4e86\u514b\u9686\uff08 Clon [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,9,66],"tags":[354,355,352,353],"class_list":["post-2144","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-qdac","category-qdb","tag-clone","tag-copyfrom","tag-352","tag-353"],"views":4074,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/2144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2144"}],"version-history":[{"count":3,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/2144\/revisions"}],"predecessor-version":[{"id":2163,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/2144\/revisions\/2163"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}