ad db code