How to pull active user name from drupal 6
Drupal 6 supports multiple DBMS connections easily in settings.php (to the same type of DBMS, eg 2 Mysql DBs, not 1 MySQL and 1 SQLServer).

You can use a function like hook_user to track who has logged in and feed that username into your 2nd database using the database api and for instance the db_query function. You also likely need db_set_active.

EDIT

I'm not sure exactly what your trying todo. You can always use php's ldap functions to talk to ldap and look for info on the "user" (if they're not logged in yet I have no clue what you'd grad from ldap ...). You could always use hook_form_alter to assign additional submit handlers on any default drupal form to perform custom tasks.

Having used ldap_integration for D6. You should realllly think about moving the site to D7 as the new ldap module is pretty nice and lets you save off ldap queries as re-runnable things :).