WordPress, IIS7, SQL Server 2008, not showing posts (displays ‘Nothing Found…’) and only shows counts in admin – how to fix?

I had the same problem. From my log file I can see its breaking on the query that returns the posts.

I managed to get this working by going to “wp-includes\query.php”, and then removing the $limits variable from the query.

It seems that this is breaking on sql server.

Find this line:

$this->request = ” SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits”;

change to:

$this->request = ” SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby”;

Let me know if this worked for you.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)