Connect to legacy database