Here are some tutorials on this topic:
Connecting to an external data source in Flash Builder
The above movie is part of the Rich Internet Applications 101 series on Adobe TV:
There is also an html tutorial here:
(it covers use of a ColdFusion service for the database, but you may still find many parts of it useful).