title: Need to save One to many relationship VB6
body: <p>So I have to save from a grid where there are two types of IDs. LineId &amp; CustId. There can be multiple CustIds for each LineId. An example of data would be like this:</p>
  
  <pre><code>LineId     CustId
  1          33
  2          98
  7          101
  1          51
  3          28
  7          02
  1          35        
  </code></pre>
  
  <p>I need to save the code with a save procedure that accepts a null-delimited string of CustIds for each Line id. I call the save procedure once for each LineId being saved. I cannot change how the save procedure works.</p>
  
  <p>So far I have been adding the grids to a type array with line id and cust id. </p>
  
  <pre><code>Dim typeRows(gridRows - 1) As Ids 'gridRows is rowcount of grid
  For i = 0 To grid.Rows - 1
      typeRows(i).LineId = grid.TextMatrix(i, GridColumns.colLineId)
      typeRows(i).CustId = grid.TextMatrix(i, GridColumns.colCustId)
  Next
  </code></pre>
  
  <p>But I'm a little stuck on what I should do next. Should I sort the grid? Then how would I go through the sorted grid and combine cust ids for each lineid?</p>
  
  <p>Any help or guidance would be very appreciated.</p>