adodc控件循环后text值不随这变化?
要实现command单击后,adodc开始循环,adodc与datagrid连接,循环过程中,当datagrid自动移动时,想让text的值跟着变化,怎么实现?
Do While Not Adodc6.Recordset.EOF
Adodc6.Recordset.MoveNext
Loop
text1.text=Adodc1.Recordset.Fields(4)
[解决办法]
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Do While Not Adodc6.Recordset.EOF
Sleep 100
Adodc6.Recordset.MoveNext
DataGrid1.Refresh
Text1 = Adodc1.Recordset.Fields(4)
Text1.Refresh
Loop
[解决办法]
只要在
text1 的datasouce属性设置为adodc16,datafeild 属性设置为你希望显示的数据库字段名称,一行代码都不用写,就能跟你循环了