Results 1 to 2 of 2

Thread: code for data comparing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    116

    code for data comparing

    Hi All
    I want to make a code which is used to compare two tables data and difference add in third table called result.but I could not complete it sucesscessfuly Please check the problem.


    Dim rs As New ADODB.Recordset
    Dim rs1 As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset


    rs.Open "select * from texcel", con

    rs2.Open "select * from result", con, adOpenDynamic, adLockOptimistic





    Do While Not rs.EOF
    rs1.Open "select * from WMS where category='" & rs!category & "' and item='" & rs!Item & "'", con

    If rs1.RecordCount = 0 Then

    rs2.AddNew
    rs2!category = rs!category
    rs2!Item = rs!Item
    rs2!remarks = "Item not found in WMS"
    rs2.Update

    End If


    rs1.Close

    rs.MoveNext

    Loop

    MsgBox "Data Matching is complete", vbInformation + vbOKOnly, "Jafri Soft"

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: code for data comparing

    but I could not complete it sucesscessfuly
    Your code looks complete to me?

    Please check the problem
    What is the problem? Do you get any errors?

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