Office中国论坛/Access中国论坛

标题: 与ADO操作记录集关联的进度条 [打印本页]

作者: zhengjialon    时间: 2004-8-25 01:10
标题: 与ADO操作记录集关联的进度条
与ADO操作记录集关联的进度条,这是一个利用ADO读取或者操作记录集时同时显示进度的示例,在运行的同时注意状态栏,ACCESS的内置进度条,也在同时进行进度的显示,前提是你在数据库窗口中启用了状态栏。




作者: huanghai    时间: 2004-8-25 03:29
不错的例子,学习。
作者: Benjamin_luk    时间: 2004-8-25 17:11
The following example creates a snapshot-type Recordset object, reads each record, and displays a progress meter showing the current relative position in the snapshot.Function ReadRecords(strTableName As String) As Integer

Const conBadArgs = -1

Dim dbs As Database, rst As Recordset

Dim lngCount As Long, strMsg As String

Dim varReturn As Variant, lngX As Long



ReadRecords = 0

If strTableName <> "" Then

  DoCmd.Hourglass True

  Set dbs = CurrentDb

  On Error Resume Next

  Set rst = dbs.OpenRecordSet(strTableName)

  ' Get record count.

  rst.MoveLast

  rst.MoveFirst

  If Err Then

   ReadRecords = conBadArgsEnd If

  lngCount = rst.RecordCount

  On Error GoTo 0

  If lngCount Then

   strMsg = "Reading " & UCase$(strTableName) & "..."

   varReturn = SysCmd(acSysCmdInitMeter, strMsg, lngCount)

   ' Display message in status bar.

   For lngX = 1 To lngCount

    varReturn = SysCmd(acSysCmdUpdateMeter, lngX)

   ' Update meter.

    .        ' Do something with record.

    .

    .

    rst.MoveNext    ' Go to next record.Next lngX

   varReturn = SysCmd(acSysCmdClearStatus)

   GoSub CloseObjects

   ReadRecords = lngCount  ' Return number of records.

   Exit Function

  End If

End If

' Not found or contains no records.

strMsg = "Table '" & strTableName & "'not found or contains no records.'"

MsgBox strMsg, vbInformation, "ReadRecords"

GoSub CloseObjects

Exit Function

CloseObjects:

On Error Resume Next

rst.Close

dbs.Close

On Error GoTo 0DoCmd.Hourglass False

Return

End FunctionACCESS97 都有现成的例子,[em01]
作者: tz-chf    时间: 2005-7-31 19:50
如果不用DoEvents,就不能看见效果,跟重画一样。
作者: benlty    时间: 2006-7-19 19:34
值得学习
作者: BILLFEI    时间: 2007-11-23 23:28
:hug: :hug: :hug: :hug: :hug:
作者: xuwenning    时间: 2007-11-27 09:47
学习
作者: ycxchen    时间: 2008-10-8 17:51
学习一下
作者: heqing3000    时间: 2008-10-14 12:40
[:50] [:50]
作者: fengtao666    时间: 2008-11-2 23:32
看看是什么样的
作者: towerman    时间: 2009-1-31 08:53
看看
作者: lzx-shmily    时间: 2009-3-6 10:43
看看
作者: popo559    时间: 2009-3-13 06:25
看看
作者: 7777777    时间: 2009-3-19 15:43
dddddddd
作者: byte204    时间: 2009-4-21 16:55
赞一个
作者: byte204    时间: 2009-4-21 16:56
赞一个
作者: 4848    时间: 2009-4-21 17:00
学习
作者: dxy27    时间: 2009-4-24 11:48
顶,好东东。
作者: yanlj518    时间: 2009-5-9 12:03
学习学习
作者: 鱼求雨    时间: 2009-5-12 22:52
学习一下,很感谢
作者: chaojianan    时间: 2009-5-13 11:42
回复了学习学习。
作者: jackysu78    时间: 2009-5-13 11:52
学习
作者: taotao123    时间: 2009-6-3 15:16
我也来学习一下
作者: corot_liu    时间: 2009-6-9 14:14
谢谢分享
作者: czsjw    时间: 2009-6-20 10:16
ADO操作记录集关联的进度条
作者: fnsmydyang    时间: 2009-6-25 22:17
学习学习...
作者: airchinazj    时间: 2009-9-27 22:40
学习
作者: yuayua23    时间: 2009-10-8 17:09
谢谢,学习了
作者: guten    时间: 2009-10-12 23:32
看看
作者: iamee    时间: 2009-12-23 21:22
kankan
作者: postzw    时间: 2009-12-31 08:41
是源码吗?
作者: kent_73    时间: 2010-8-21 09:41

作者: yanwei82123300    时间: 2011-5-16 11:00
看看再说
作者: 11111111    时间: 2011-6-9 20:13
ddddddddddddd
作者: caoguangyao    时间: 2011-6-9 20:24
学习一下
作者: STD    时间: 2011-7-18 10:30
学习
作者: lovettww    时间: 2012-5-12 14:08
看看了。。。
作者: wgh3g    时间: 2012-5-12 14:34
看看
作者: watch1cn    时间: 2012-5-17 15:07
好东西,学习一下
作者: LeeTien    时间: 2012-11-23 14:41
学习了
谢谢
作者: huangli0356    时间: 2013-6-24 14:50
好东西。。谢谢分享。
作者: jc2016    时间: 2013-9-2 16:53
看看
作者: gl_zhangt    时间: 2014-3-11 16:06
多谢分享
作者: zxclen    时间: 2014-8-25 11:14
SEEEEEEEEEEEEEEEEE
作者: p51219    时间: 2015-12-3 23:33
学习学习
作者: p51219    时间: 2015-12-3 23:33
学习学习学习学习学习学习
作者: p51219    时间: 2015-12-3 23:41
学习学习
作者: Alashome    时间: 2015-12-10 07:57
good
作者: Michael0512    时间: 2016-1-14 21:15
好好啊好哦
作者: yzx_sz    时间: 2016-1-15 18:58
学习
作者: yzx_sz    时间: 2016-1-18 13:29
学习
作者: 玉树TMD临风    时间: 2016-2-11 23:30
我来看看。
作者: adau2    时间: 2016-2-27 22:37
2222222222
作者: 林鸟    时间: 2016-4-25 15:43
看一下
作者: czzlj520    时间: 2016-4-26 08:18
需要这个功能
作者: bbpst    时间: 2016-4-28 09:29
学习学习
作者: mlxsjlf    时间: 2016-6-18 22:51
值得学习
作者: niculas    时间: 2016-9-8 04:28
看看,这个例子有些高级
作者: 付谦    时间: 2017-5-17 11:17
学习
作者: yang0503    时间: 2019-1-9 13:53
学习一下
作者: uncletse    时间: 2019-4-10 14:12
值得学习
作者: sunwrsun    时间: 2019-5-8 22:03
看看
作者: 冚友    时间: 2019-7-19 15:11
学习一下
作者: xingzhihao    时间: 2020-11-15 10:25
看看
作者: wuwu200222    时间: 2022-4-24 16:17
学习




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3