| 发表于:2007-08-09 08:41:526楼 得分:0 |
有办法。 1 首先要引用 mdac 2.5 以上版本。使用 vb 6.0 以上平台。 2 声明变量如 dim withevents rs as adodb.recordset 3 必须使用客户游标。 4 打开记录集时必须指定 adasyncfetch dim withevents rs as adodb.recordset set rs = new adodb.recordset with rs .cursorlocation = aduseclient .properties( "initial fetch size ") = 2 .properties( "background fetch size ") = 4 .open strsql, cn, , , adasyncfetch end with 事件:(当然你可以使用进度条) private sub rs_fetchprogress(byval progress as long, byval maxprogress as long, adstatus as adodb.eventstatusenum, byval precordset as adodb.recordset) debug.print "fetch: " & progress & _ " max: " & maxprogress end sub private sub rs_fetchcomplete(byval perror as adodb.error, adstatus as adodb.eventstatusenum, byval precordset as adodb.recordset) if adstatus <> adstatusok then debug.print "failed " debug.print "error: " & perror.number & " - " & perror.description else set datagrid1.datasource = precordset debug.print "done " end if end sub | | |
|