我目前正在开发我的 vb6 程序,但在从两个表中显示一个列表视图时遇到问题.. 第一次尝试它运行正确,它将我的信息(如姓名、地址、年龄等)存储在分配的列上,但在第二次运行时。信息成倍增加,并放在列表视图的第一列:(这是我在列表视图表单上的代码:
Private Sub Form_Activate()
Set rs = New ADODB.Recordset
With rs
.open "Select * from tblapps , tblappsinfo", cn, 3, 3
ListView1.ListItems.Clear
Do Until rs.EOF
ListView1.ListItems.Add = !Name
ListView1.ListItems.Item(1).ListSubItems.Add = !address
ListView1.ListItems.Item(1).ListSubItems.Add = !tin
ListView1.ListItems.Item(1).ListSubItems.Add = !cel
ListView1.ListItems.Item(1).ListSubItems.Add = !College
ListView1.ListItems.Item(1).ListSubItems.Add = !age
ListView1.ListItems.Item(1).ListSubItems.Add = !Status
ListView1.ListItems.Item(1).ListSubItems.Add = !Salary_Desired
ListView1.ListItems.Item(1).ListSubItems.Add = !Hours_can_work
ListView1.ListItems.Item(1).ListSubItems.Add = !Available_for_work
.MoveNext
Loop
End With