我遇到一个问题,在文件中读数据,当读出有多条数据时,要判断其中某一 数据项目(或者多项)如:BBB要不能够重复,
一但有重复的数据就弹出MSGBOX.我不知道怎么解决,请大家帮帮忙.现在急着等待:
如: 数据项目 AAA    BBB    CCC   DDD    EEE    FFF
    数据     11     22     33    44     55     66
             12     12     13    55     66     77
             13     12     14    15     16     17要求BBB中部能够有重复项目!
请大家帮忙?

解决方案 »

  1.   

    select count(AAA) as ttt from table as table1 inner join table as table2 on table1.BBB=table2.BBBif ttt>=1 then
    print "错了"
    end if
      

  2.   

    把BBB读到一个集合里面吧,注意往集合里面加数据的时候,把数据同时作为 key ,因为集合里面的key是不允许重复的,因此,当试图往已有的集合里面添加重复的 key ,就会出错!
      

  3.   

    Dim aa As New Collection
    Private Sub Command1_Click()
      aa.Add Text1.Text, Text1.Text
       
    End Sub