I have the following code that when a database .mdb file is being pulled up it checks to see if the name and path is already listed in tblAdjustDBs. The trouble is that sometimes the db1.Name does not give you the full path and does a type of shorthand on the path and I end up getting duplicate entries for one database.
One example is the following:
Both are the same database but because one has the ~ sign it added it twice.
Any info on how I can avoid the above from happening?
Dim db1 As DAO.Database
Set db1 = CurrentDb()
sSelect = "SELECT * FROM [tblAdjustDBs] WHERE [DB] = '" & db1.Name & "'"
rstData.Open sSelect, cnnData, 2, 3
If rstData.EOF Then
SysCmd acSysCmdSetStatus, "Adding " & db1.Name & " to list of adjusted DBs..."
sSelect = "INSERT INTO [tblAdjustDBs] (DB, Adjust) VALUES ('" & db1.Name & "', True)"