How to put SQL-Query in DBCriteria for CActiveDataProvider

Hey guys,

I have the following SQL-Select-Statement I want to use, to populate my CActiveDataProvider.

	SELECT tb_comment.* FROM tb_user, tb_image, tb_comment 


	tb_user.idUser=1 AND 

	tb_user.idUser=tb_image.idUser AND 

	tb_image.idImage = tb_comment.idImage AND

	tb_comment.idWriter != 1

How do I put the Query in a CDbCriteria or is there a better solution? ?

Yeah that is what I was looking for…

Unfortunatly I get the error:

Undefined index: id


Here is the CSqlDataProvider:

			$recentCommentDataProvider = new CSqlDataProvider($sql, array(