with dg_query itemcount = have_subitem(query_sql, query_cnn, query_rst) Set .DataSource = query_rst Call set_hflexgrid(Me) .Refresh If itemcount >= 1 Then .FixedRows = 0 .FixedRows = 1 .ColWidth(1) = 2000 .ColWidth(0) = 1400 .ColWidth(12) = 1 Lb_count.Caption = "满足条件的记录数:" + CStr(itemcount) Else Lb_count.Caption = "满足条件的记录数: 0" End If End Sub
dim rs as new adodb.recordset dim conn as new adodb.connection rs.open "select * from table",conn,adOpenStatic,adLockOptimistic if rs.eof then exit sub set MSHFLEXGRID.DataSource=rs MSHFLEXGRID.refresh 就可以了
with dg_query
itemcount = have_subitem(query_sql, query_cnn, query_rst)
Set .DataSource = query_rst
Call set_hflexgrid(Me)
.Refresh
If itemcount >= 1 Then
.FixedRows = 0
.FixedRows = 1
.ColWidth(1) = 2000
.ColWidth(0) = 1400
.ColWidth(12) = 1
Lb_count.Caption = "满足条件的记录数:" + CStr(itemcount) Else
Lb_count.Caption = "满足条件的记录数: 0"
End If
End Sub
dim conn as new adodb.connection
rs.open "select * from table",conn,adOpenStatic,adLockOptimistic
if rs.eof then exit sub
set MSHFLEXGRID.DataSource=rs
MSHFLEXGRID.refresh
就可以了
,但是该控件只能显示4000~5000行,那剩余的记录怎么显示呢?我可不想在翻到后面的时候,手工再从记录集里再一条一条的添加入MSHFLEXGRID里面,那样的效率太低了。