If adoLogRS.State Then adoLogRS.Close Set adoLogRS = Nothing End If If db.State Then db.Close Set db = Nothing End If