adodc1 problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    adodc1 problems

    im trying to connect a datagrid on a form that has two controls (adodc1 and adodc2) on it one is for the lessor table and the other is for the lease table. i tried to use an sql statement for the lease one but i have no clue what i'm doing im useing vb6 and i have a database from access (2000) where all of this is getting it's information my access database has these fields:

    (in lessor table)

    Code:
    lessorID = autonumber
    lessor name = text
    address= text
    city = text
    state = text
    zip = text
    phone = text
    this one is run off of adodc1

    the other table i have is the lease table it has this

    Code:
    leaseID = autonumber
    lessorID = number
    rentamount= currency
    leaseterm=text
    from = date/time
    to = date/time
    this is run off adodc2 (for the datagrid)

    i have put these on one form in visual basic 6.0 i want to have the datagrid have only the information that's in the adodc1(lessors table) so when i scroll throught the lessors table the datagrid will only show there information only. pleae help me understand this

    lee123
  • creative1
    Contributor
    • Sep 2007
    • 274

    #2
    Hi Lee,
    I think if you will tell little more about your problem it will help us understand little more such as: what the issue is? and what you are looking for ?
    Kind Regards

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      Well creative1,

      It's like this the problem is how can i use the "id's" from the database to connect the two adodc's
      so when i add a new lessor the datagrid will update with that lessor's info. you know this is all on one form or do i have to have another form? i guess what im am looking for is to update the datagrid to retrieve the information from adodc1 only in sql or by other means if it's possible and where i can stick the code to do it, in the form or in the datagrid, or in a modual , a button where? do i dim things or what this datagrid and adodc's are tricky if you don't know anything about them. ms access is not that hard.

      lee123

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        instead of using adodc use ADO code and use combobox or listbox . and passthe value for the grid from the control dynamically.

        Comment

        • lee123
          Contributor
          • Feb 2007
          • 556

          #5
          hey debasisdas,

          can you give me an example code of this so i can understand what you mean?

          lee123

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            1.select the ado library from project --> reference.
            2.open the conection.
            3.open the 1st recordset.
            4.fill the first listbox from this recordset.
            5.on the selection of the listbox open another recordset.
            6.fill the 2nd lisbox from second recordset.
            7.on the selection of the 2nd listbox open 3rd recordset .
            8.from this recordset populate the grid control.

            Comment

            • lotus18
              Contributor
              • Nov 2007
              • 865

              #7
              Hi Lee123

              This may help you also, click

              These are the basic SQL Syntax for Access Queries

              Rey Sean
              Last edited by lotus18; Jan 4 '08, 05:42 AM. Reason: change the link

              Comment

              Working...