谢了三断笛,姓名查询的已解决,也可以在其它的电脑上运行,还没有解决的是指定时间的查询,我用了SQL:
Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
Dim w As String
'声明变量,用来保存SQL语句字符串
'如果没有选择部分信息,则退出
If DTPicker1.Text = "" Then
Exit Sub
End If
'DTPicker1.BoundText是当前的时间,
'以此编号设置SQL语句,读取此时间内的所有病人药品信息
w = "select
* from dbo.AdviceListView where roomcode=2000 and intime= '" _
& DTPicker1.BoundText & "' order by intime desc"
With Adodc1
.RecordSource = w
.Refresh
End With
With DataGrid1
.RecordSource = w
.Refresh
End With
End Sub
但没用,请帮我看一下