Private Sub Command1_Click()
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "yyyy.mm.dd"
MsgBox DTPicker2.Value
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim Str1 As String
Dim Str2 As String
Dim Str3 As String
Str1 = "Provider=Microsoft.Jet.OLEDB.4.0;"
Str2 = "Data Source=E:\xjgl.mdb;"
Str3 = "Jet OLEDB:Database Password="
conn.Open Str1 & Str2 & Str3
strsql = "select * from grcx where 进场日期>'" & DTPicker1.Value & "'" & "and 进场日期<'" & DTPicker2.Value & "'"
rs.Open strsql, conn, 3, 3
rs.Close
conn.Close
Adodc1.Refresh '刷新数据源,MSHFlexGrid控件会实时刷新显示数据
End Sub
数据库改成文本格式后不报错了,但是数据完全没有筛选啊???