****一个关于ado的问题:怎么系统就是不行,哎****

wxm322000 2003-03-27 10:15:18
Private Sub List1_Click()

If List1.SelCount > 0 Then
i = List1.ListIndex

Dim rsstu As New ADODB.Recordset
rsstu.CursorLocation = adUseClient
rsstu.CursorType = adOpenKeyset
rsstu.LockType = adLockPessimistic
rsstu.Open "select * from reginfo order by SID", wxmserver
For j = 0 To i - 1
rsstu.MoveNext
Next
Label6.Caption = rsstu(2)
Label8.Caption = rsstu(0)
Label12.Caption = rsstu(1)
Label16.Caption = rsstu(4)
Label18.Caption = rsstu(3)
rsstu.Close

Dim rsstu1 As New ADODB.Recordset
rsstu1.CursorLocation = adUseClient
rsstu1.CursorType = adOpenKeyset
rsstu1.LockType = adLockPessimistic
rsstu1.Open "select * from studentinfo order by SID", wxmserver
rsstu1.MoveFirst
Do Until rsstu1.EOF
If rsstu1(0) = Label8.Caption Then
Label10.Caption = rsstu1(0)
Else: rsstu1.MoveNext
End If
Loop
rsstu1.Close

End If
End Sub

代码的目的是为了将list1表中的内容写在label上,如果我只完成rsstu部分,显示很好,但是加入rsstu1部分后,系统就没有反应了,不知道是怎么回事,大家有什么更好的办法吗?谢谢!
...全文
29 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
sxs69 2003-03-27
Do Until rsstu1.EOF
If rsstu1(0) = Label8.Caption Then
Label10.Caption = rsstu1(0)
exit do
end if
rsstu1.MoveNext
Loop
回复
相关推荐
发帖

1187

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
帖子事件
创建了帖子
2003-03-27 10:15
社区公告
暂无公告