msflexgrid怎么才显示多行数据
来源:百度知道 编辑:UC知道 时间:2024/09/12 17:59:16
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\cheng.mdb;Persist Security Info=False"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
showtitle
showdata
End Sub
Public Sub showdata()
Dim i As Integer
Adodc1.RecordSource = "select * from P2"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
MSF.TextMatrix(1, 0) = Adodc1.Recordset.Fields(0)
MSF.TextMatrix(1, 1) = Adodc1.Recordset.Fields(1) <
例子一个,请你好好看看....
If Combo1.Text = "全部" Then
If Text1.Text = "" And Text2.Text = "" Then
Ssql1 = "SELECT 赔案号,出险日期,赔金额,牌照号,所属业务员,意向书号,险种,被保险人名称,电话,保单号,录入日期 FROM LP_001 where 录入日期>= #" & DTP1 & "# And 录入日期<= #" & DTP2 & "#"
Else
Ssql1 = "SELECT 赔案号,出险日期,赔金额,牌照号,所属业务员,意向书号,险种,被保险人名称,电话,保单号,录入日期 FROM LP_001 where 录入日期>= #" & DTP1 & "# And 录入日期<= #" & DTP2 & "# and 赔金额>=" & P & " and 赔金额<=" & Q & ""
End If
End If
i = 0
j = 0
RS.Open Ssql1, m_Cnn, adOpenStatic, adLockOptimistic
REC = RS.RecordCount
If REC = 0 Then
MsgBox "符合条件的记录为0,网格无法显示.......", vbOKOnly, "运行提示"
RS.Close
Exit Sub
End If
i = REC
Q1 = i
MSFlexGrid1.R