if you forgot the lock screen code for the iPad, just back it up to iTunes and restore it
if you forgot your iCloud password just go to iforgot.apple.com
if you cant do either, then your are screwed.
as long as you backed up your iPad to iTunes, it knows how to connect to your iPad
even if you change the lock screen code. iTunes still knows!