With A HDD online with XP only , insert XP disk and open recovery console on startup right away by pressing "R" when the screen shows up.
Once the Recovery Console loads up, you will have to type in a number that corresponds to your Windows installation. This is normally just 1. Press Enter and then type in the Administrator password. Then type :
bootcfg /rebuild or Bootrec /rebuild /*to rebuild your boot config*/
fdisk /mbr
and wait for the process to complete.After that , type
Shutdown
Xp should boot now
Now Remove A and insert B hdd with Ubuntu 10.04 :-
Boot using the LiveCD. Open a Terminal and type in the following commands :
sudo grub
> find /boot/grub/stage1 /*finds grub location on the drive */
> root (hd0,x) /*x should be replaced by drive no. of your /root*/
> setup (hd0)
> exit
Now Online all HDDs and goto win7, see if its booting or not

If not then try these steps :-
1.Insert Win 7 installation DVD and boot from DVD drive.
2. Choose your default "Language", "Time", and "keyboard Input" on the first window and click next.
3. Now Click on "Repair Your Computer" to gain access to the System Recovery window. Now choose "Command Prompt" in order to run the desired utility which is called "bootsect.exe". Bootsect is located inside the boot folder so change your directory to boot.
4.Now run "
bootrec.exe /nt60 C:\" (default position of your Windows partition is C:/). After that, type
bootrec.exe /fixmbr
bootrec.exe /fixboot
bootrec.exe /rebuildbcd
Restart and this will fix win7 loader without making any harm to XP loader (trust me i run 4 OS in my pc i.e. win7,XP,openSUSE,and ubuntu 10.04) but make sure you remove B hdd with Ubuntu installed. For details
see
After making all HDDs live, goto ubuntu and open terminal, then type :-
sudo update-grub
and your win7 bootloader will get an entry in grub 2 of ubuntu