求解virtual listview问题
我用listview控件可以连接数据库并显示,但是显示太慢,听网上说虚拟listview可以加快速度,但小弟不知如何修改 这是我listview的代码,请大神指点下 如何改成虚拟模式显示Option Explicit
Function action
Dim objConnection
Dim strConnectionString,objCommand
Dim strSQL,rec
Dim i,tag1,ListX,olist
Dim m
strConnectionString = "Provider=SQLOLEDB.1;User ID=sa;Password=sa;Data Source=RAL-9ZQ7XW51VI3\WINCC ;Persist Security Info=ture;Initial Catalog=sg2800" 'Data Source=ral\WINCC
Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnectionString
objConnection.Open
Set rec=CreateObject("ADODB.Recordset")
strSQL="select * from schedule"
rec.open strSQL,objConnection
Set olist=HMIRuntime.Screens("NewPdl3").ScreenItems("ufc")
oList.ListItems.Clear
Do Until rec.EOF
Set ListX =olist.ListItems.Add()
For i =1 To 2
listx.SubItems(i) = CStr(rec.Fields(i).Value)
Next
rec.MoveNext
Loop
rec.close
Set objCommand=Nothing
objConnection.Close
End Function
补充:VB , 控件