开发教室
程序设计|Delphi|Java|C++|VB|.NET|Css|Js|PHP|ASP|MySQL|数据库|WEB开发|网页特效|视频
首页 > 开发教室 > 程序设计 > VB > 正文

克隆ADO记录集时考虑Key Ponits

2007-04-10 源自: 网友评论 0 进入视频教程

  Key points to consider when cloning ADO recordsets

As you can probably guess, the ADO Clone() method creates a copy of the
original recordset. However, be aware that this method does NOT create
two independent recordsets. Rather, it creates two recordset objects
that point to the same records. Changes made to records in one clone
affect all other recordset objects. On the other hand, if you requery
the original recordset, the cloned copies won注释:t be updated, assuming
of course that the requeried recordset contains new data.

Also only bookmarkable recordsets--those with keyset and static cursor
types, for the most part--allow bookmarks, so your code should
determine that a target recordset allows the process before attempting
to clone a recordset. To initiate this test, check the recordset注释:s
Supports property in conjunction with the adBookMark constant, like so

If rstOrig.Supports(adBookMark) Then
     Set rstSub1 = rstOrig.Clone
End If

上一篇: 检测 Shell 部件的版本
下一篇:可以在程序中动态建立临时表

评论  点击查看
 
开发频道推荐
开发热点文章