Is there a theme function for is_password_protected()?

Yes there is. It’s post_password_required:

Whether post requires password and
correct password has been provided.

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