我想把查询到的符合两个时间内的数据显示在DataGrid1上,可我的程序DataGrid1上只显示一条空数据。这是怎么回事啊
Dim strSQL As String
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\abc\1.mdb;Persist Security Info=False"
strSQL = "select*from 123 where 时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "#"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strSQL, conn, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
Dim strSQL As String
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\abc\1.mdb;Persist Security Info=False"
strSQL = "select*from 123 where 时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "#"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strSQL, conn, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
strSQL = "select * from 123 where 时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "#"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strSQL, conn, adOpenkeyset, adLockReadOnly
Set DataGrid1.DataSource = rs
select * from 123 where 时间 between #2010-04-27 00:59:59 # and #2010-04-27 10:00:00#
select * from 123 where 时间 between #2010-04-27 00:59:59 # and #2010-04-27 10:00:00#
select * from 123 where 时间 between #2010-04-27 00:59:59 # and #2010-04-27 10:00:00#
我变了个条件strSQL = "select * from 123 where 压力 =24"查询就很好用查询2个时间之间的数据还有别的查询条件吗