diff --git modules/dblog/dblog.module modules/dblog/dblog.module
index d0e0c40..98f92db 100644
--- modules/dblog/dblog.module
+++ modules/dblog/dblog.module
@@ -107,15 +107,12 @@ function dblog_cron() {
   // Counting the most recent n rows avoids issues with wid number sequences,
   // e.g. auto_increment value > 1 or rows deleted directly from the table.
   if ($row_limit > 0) {
-    $min_row = db_select('watchdog', 'w')
-      ->fields('w', array('wid'))
-      ->orderBy('wid', 'DESC')
-      ->range($row_limit - 1, 1)
-      ->execute()->fetchField();
+    $query = 'SELECT wid FROM {watchdog} ORDER BY wid DESC';
+    $min_row = db_query_range($query, $row_limit-1, 1)->fetchField();
 
     // Delete all table entries older than the nth row, if nth row was found.
     if ($min_row) {
-      db_delete('watchdog')
+      Database::getConnection('default', 'default')->delete('watchdog')
         ->condition('wid', $min_row, '<')
         ->execute();
     }
