Private Sub Command6_Click()
dim rs as Recordset
Adodc1.RecordSource = StrSQL
Adodc1.Refresh
MSHFlexGrid1.Refresh
If rs.EOF And rs.BOF Then
MsgBox "查无此人", 64, "提示"
End If
End Sub
为什么记录集不好用?是不是我用的不对,该怎么用?请详细一点。最好能写一段类似的代码看看,非常感谢。
...全文
612打赏收藏
帮忙分析Recordset
Private Sub Command6_Click() dim rs as Recordset Adodc1.RecordSource = StrSQL Adodc1.Refresh MSHFlexGrid1.Refresh If rs.EOF And rs.BOF Then MsgBox "查无此人", 64, "提示" End If End Sub 为什么记录集不好用?是不是我用的不对,该怎么用?请详细一点。最好能写一段类似的代码看看,非常感谢。
dim rs_Dairy As New ADODB.Recordset
dim cnn As New ADODB.Connection
dim m_ConnectionString As String
dim m_Sql As String
m_ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=H:\公司程序\打印\工作计划\Dairy.mdb"
m_Sql = "SELECT * FROM Dairy"
cnn.ConnectionString = m_ConnectionString
cnn.Open
rs_Dairy.Open m_Sql, cnn
If rs_Dairy.EOF And rs_Dairy.BOF Then
MsgBox "查无此人", 64, "提示"
End If