vb listbox中的记录全部选中后,如何逐条读取记录呢?
1个回答
展开全部
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
Call ConnectSql
txtsql = "select * from 表名 where 字段名='" + Trim(List1.List(i)) + "'"
mrc.Open txtsql, connect, adOpenKeyset, adLockOptimistic
mrc.Fields("字段名") = Text1.text
mrc.Update
mrc.Close
End If
Next i
If List1.Selected(i) = True Then
Call ConnectSql
txtsql = "select * from 表名 where 字段名='" + Trim(List1.List(i)) + "'"
mrc.Open txtsql, connect, adOpenKeyset, adLockOptimistic
mrc.Fields("字段名") = Text1.text
mrc.Update
mrc.Close
End If
Next i
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询