1: VSFlexGrid1.colHidden(0) = True 2: dim rs as new adodb.recordset rs.open "select * from company",cn set vsflexgrid1.datasource=rs rs.clolse 3:重新 set vsflexgrid1.datasource=rs即可
我有一段: Dim rst As ADODB.Recordset Dim strSQL As String With FlexGrid .FormatString = "=ID| 日期 | 房号 | 价格" .ColHidden(0) = True End With
strSQL = "select ID,orderDate,RoomNO,price from hotel" Set rst = myConn.Execute(strSQL) Set FlexGrid.DataSource = rst Set rst = Nothing这样运行后ID还是看得到地
试试这样行不行: Dim rst As ADODB.Recordset Dim strSQL As String With FlexGrid .FormatString = "<ID|< 日期 |<房号 |> 价格" .ColHidden(0) = True End With
strSQL = "select ID,orderDate,RoomNO,price from hotel" Set rst = myConn.Execute(strSQL) Set FlexGrid.DataSource = rst FlexGrid.Refresh Set rst = Nothing
MSFlexGrid1.FixedCols = 0
VSFlexGrid1.colHidden(0) = True
2:
dim rs as new adodb.recordset
rs.open "select * from company",cn
set vsflexgrid1.datasource=rs
rs.clolse
3:重新 set vsflexgrid1.datasource=rs即可
Dim rst As ADODB.Recordset
Dim strSQL As String With FlexGrid
.FormatString = "=ID| 日期 | 房号 | 价格"
.ColHidden(0) = True
End With
strSQL = "select ID,orderDate,RoomNO,price from hotel"
Set rst = myConn.Execute(strSQL)
Set FlexGrid.DataSource = rst
Set rst = Nothing这样运行后ID还是看得到地
Dim rst As ADODB.Recordset
Dim strSQL As String With FlexGrid
.FormatString = "<ID|< 日期 |<房号 |> 价格"
.ColHidden(0) = True
End With
strSQL = "select ID,orderDate,RoomNO,price from hotel"
Set rst = myConn.Execute(strSQL)
Set FlexGrid.DataSource = rst
FlexGrid.Refresh
Set rst = Nothing