The key is web services.
The basic database connectivity in InfoPath has limitations as you have encountered.
InfoPath was designed to use web services and they give you all of the functionality.
You can both query and submit to multiple tables.
Send me an email and I could show you some examples.