Well in short, you use a mediating programming language like PHP or ASP. You can import variables and information into Flash, but you just need one of those languages to provide the access to the database. Its not...exactly simple but its definitely not impossible.
I use PHP (if necessary, I'm not a huge programmer yet) and have done some of this in its basic form. Here are some tutorials - look at the section with AMFPHP, which is a package which helps to facilitate between PHP and Flash.
http://www.sephiroth.it/tutorials.php