How to compare two tables fieldname and then make them to be corresponded

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anne36
    New Member
    • Mar 2010
    • 1

    How to compare two tables fieldname and then make them to be corresponded

    I have a question for how tocompare two tables fieldname and then make them to be corresponded. The original file could be CSV or EXCEL, the destination table is ACCESS. How to use VB coding to program two tables fieldname to be corresponded and then using this corresponded reference table to convert CSV and EXCEL file into ACCESS table?

    In addition, the history correspondence can be memorized to make this function more clever?

    _______________ _______________ _______________ _______________ _
    For example:

    Original CSV/ EXCEL file:

    First_Name,Last _Name,Title,Com pany,Phone,Fax, Phone_-_Mobile,Email,W eb_Page
    Jadp,Daas,Sr. Product Manager,Saabase Inc.,(955) 236-5214,(955) 236-6179,,jaadpdas@ sabase.com,www. sabase.com
    Jbdp,Dbbs,Sr. Product Manager,Sbbbase Inc.,(955) 236-5214,(955) 236-6179,,jbbdp.das @sbbbase.com,ww w.sbbase.com

    Destination ACCESS table structure:
    ContactFirst,Co ntactLast,Conta ctTitle,Contact Company,Contact Phone,ContactFa x,ContactMobile ,ContactEmail,C ontactwebpage

    ------------------------------------------------------------------------------------------------------

    Any helps and guidence will be greatly appreciated.

    Best Regards,
    Anne36
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    ADOX will read the properties of a table (or DAO will) and since it is a CSV file and not an actuall xls file you can use the Open Statement along with the Line Input function to read the first line. Display the field names in one list box and the field name from the CSV after a Split in another. Allow the user to select one from each list box and hit a button "create" to associate CSV with field. Then you will need to save this information into the database or some other file and all of this can be found by using your friends (yahoo, google, ask, answer, bing)...



    Good Luck

    Comment

    Working...