dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Database Problem

  1. #1
    eddie Guest

    Database Problem


    I am trying to read from one table into some variables and add new info into
    another table through these variables.
    For example, I read table A and save the info into variables x,y,z; and then
    I update table B's fields with
    x,y,z. How could I do it in codes? Thanks

  2. #2
    Miroslav St. Jeliazkov Guest

    Re: Database Problem

    Hi eddie,
    > I am trying to read from one table into some variables

    here you can use a Data Control and get any fields you want
    from the file you have connected it with the properties
    window in VB:

    Data1.DatabaseName is the file1
    Data1.Recordsource is the table1
    Data2.DatabaseName is the file2
    Data2.Recordsource is the table2

    >I read table A and save the info into variables x,y,z

    Geting the data form the fields is like that:

    x = Data1.Recordset!field1 'change the field1 and field2
    y = Data1.Recordset!field2 'with the proper name of the
    fields
    z = Data1.Recordset!field3

    > I update table B's fields with x,y,z

    Then you must put that data in the other table

    Data2.Edit
    Data2.Recordset!field4 = x
    Data2.Recordset!field5 = y
    Data2.Recordset!field6 = z
    Data2.Update

    It's somthing like this

    Regards
    Miro



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center