CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    arrays (multidimensional)

    Hi,
    here is my question. I have 2 fields in my recordset. A rs!relationship(mother, father.....) and rs!relation_id. I need to populate an array with both of these fields of the rs. I also have a grid where these fields show up in 2 columns. When the user tries to change a name I have to call the array and see if that relationship in that particular cell and row already has an id. (e.g. mother = 1, father = 2....). If the relationship matches with an id than I have to take this id and put it in a variable(relationId) for further use. If the relationship is not in the array I need to add it to the array and give it a new id and take that new id and put it in the variable(relationId).
    I have absolutely no glue about arrays. So, please help!!!!!!! I am working with an adodb.rs.
    Thanks for any help that I can get.
    Christa


  2. #2
    Join Date
    Feb 2000
    Location
    America
    Posts
    130

    Re: arrays (multidimensional)

    I didn't completely understand your question, so this may or may not work. Try using a for next loop inside of another for next loop, looping through the multidimensional control arrays and checking them to see if they match. for example...

    For Blah = 0 to FirstDimensionLimit
    For Blah2 = 0 to SecondDimensionLimit
    GridCell(Blah,Blah2) = MyControlArray(Blah, Blah2)
    Next Blah2
    Next Blah

    Again, I didn't completely understand your question, so I don't know if this helps. Hope it does.


  3. #3
    Guest

    Re: arrays (multidimensional)

    Thanks for your answer, but this is not quite what I'm looking for. I need to populate the array(1,6) (1 = two columns(relationship and id),6 = possible # of ids, mother = 1, father = 2 etc) with the 2 fields in the rs.(which I don't know how) Then I need to compare the value of the cell(relationship column, eg mother) in the grid and find out if there is already a "mother" in the array and what id "she" has. If she has an id I need to take that id and put it in the cell(id column), update the rs and go on with life. If mother is not in the array I have to add it to the array, add an id, than take that information, put it in the cell, update my rs and go on..
    I hope this explains it a little better.
    Any glues?
    Thanks a lot for any help.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured