Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.

In reply to Re: Inserting values into MS Access sub tables by sedhed
in thread Inserting values into MS Access sub tables by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-28 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found