How to select posts from multiple categories and metavalues?

Since version 3.1 WP got much enhanced querying of custom fields. If I got the code right your query should be something like this:

query_posts(array(
    'category__and' => array(1,2,3),
    'meta_query' => array(
        array(
            'key' => 'length',
            'value' => array($min_length, $max_length),
            'compare' => 'BETWEEN',
            'type' => 'NUMERIC',
        ),
    ),
));

See:

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