http://qs321.pair.com?node_id=180258


in reply to Inserting values into MS Access sub tables

Please correct me if I'm misunderstanding your question. Also, I'm not familiar with Win32::ODBC, I use DBI. But this is more of a database design thing, not database or connection specific.

While many database systems do have the functionality to specify tables' relationships, one relies on that functionality only to enforce referential integrity on a DBMS level. Your code still needs to account for those same relationships.

To that end, one generally places a corresponding key field in each table, so that the tables can be JOINed in statements. So your servers_tbl already has an key field, which is a unique primary key. So far so good. Put a corresponding field in your drives table, called 'server_id' or something, and use that field to join on.

Your basic data would look something like so....

servers_tbl:                drives_tbl:
_ID____NAME_____            _LETTER__SERVERID____FOO___
1     SomeServer            C        2          blahblah   
2     OtherServer           D        2          ahblahbla
956   YetAnotherServer      C        956        foobar
And a select to get all of OtherServer's drives might look something like:
SELECT drives_tbl.LETTER, drives_tbl.FOO, servers_tbl.NAME FROM servers_tbl LEFT OUTER JOIN drives_tbl on servers_tbl.ID = drives_tbl.SERVERID WHERE servers_tbl.NAME = "OtherServer"
Hope this helps.