You can programmatically attach a database by calling the Create Database.vi in LabVIEW. This will do the same thing as Chris described doing in MAX. Once you have the database created ("attached"), you can call the Get Trace List.vi to see which traces are available in the database.
If you need some further help in building the database path, you'll probably find the Build Path.vi or other VI's on the File I/O palette helpful.
I hope this helps. If you have more questions, please post a reply.
Regards,
Kristi H
National Instruments