看不懂你Time$()是干嘛的。
应该这样写
Sub timer1_timer()
Dim objConn As New ADODB.Connection
Dim strConn As String
strConn = "
rovider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database.mdb
ersist Security Info=False"
objConn.Open strConn
Dim rS As New ADODB.Recordset
Dim sqlstmt As String
sqlstmt = "select * from 预约单 WHERE 预约时间 LIKE " + Trim(Str(Label1.Caption))
Set rS = objConn.execute(sqlstmt)
If rS.EOF Then
MsgBox "有预约", "请注意"
End If
rs.close
set rs=nothing
objConn.close
set objConn=nothing
End Sub
[
本帖最后由 qxl584 于 2006-7-29 10:46 编辑 ]