Here is an example on how to do this with ADO. First you need to set a reference in your project to the Microsoft ActiveX Data Objects library (msado15.dll).
'==========================================================
Sub CheckForAppointment()
' Declare variables
Dim objDBConnection As ADODB.Connection
Dim objDBRecordset As ADODB.Recordset
Dim strSQL As String
' Create the necessary objects
Set objDBConnection = CreateObject("ADODB.Connection"

Set objDBRecordset = CreateObject("ADODB.Recordset"
' Set the appropriate attributes for the objects
With objDBConnection
.ConnectionString = "Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb"
.CommandTimeout = 300 '5 minutes
.Open 'Opens the connection to the DB
End With
With objDBRecordset
.CacheSize = 1 'We only care if we find ANY records, so don't waste resources caching a lot
.CursorLocation = adUseServer 'Keeps the cursor at the DB server for better performance
.CursorType = adOpenForwardOnly 'This cursor type uses the lest resources and is fine for what we are doing here
.LockType = adLockReadOnly 'We don't need a more complex locking scheme since we are just "looking"
End With
' Set the query string
strSQL = "select * from <table name> where <date field> = '<date search value>' and <time field> = '<time search value>'"
' Execute the query and return data to the recordset
objDBRecordset.Open strSQL, objDBConnection
' Check to see if we found any records
If Not objDBRecordset.EOF Then
' We found records with that criteria - do whatever we need to
' in order to make the user change the appointment date and time
End If
' Cleanup after ourselves
objDBRecordset.Close
objDBConnection.Close
Set objDBConnection = Nothing
Set objDBRecordset = Nothing
End Sub