Multisite, using switch_to_blog in filter

Did you use as follows (here $blog_id as 1):

 switch_to_blog( 1 );
 //Do stuff
 restore_current_blog();

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