Yes, if you use the Drop Down List form control, there is an option to use SQL query to generate the list of options. Certainly, there connection to the other database would have to be available for the site.
Is the web part you are talking about a custom web part?