In your code you should have one connection each to the databases. Either you can use the method given by Wof or you can open two different recordset for each database and use
RS.Find method to find a specific record. If record doesnot exist Rs.eof will be true otherwise false, with above hints you can build your own logic and apply to your code.