本帖最后由 iori2882 于 2013-12-7 17:16 编辑
麻烦问一下,下面的语句是查询表内重复字段并且给出重复次数的SELECT First(Worklode_complete.姓名电话) AS [姓名电话 字段], Count(Worklode_complete.姓名电话) AS NumberOfDups
FROM Worklode_complete
GROUP BY Worklode_complete.姓名电话
HAVING (((Count(Worklode_complete.姓名电话))>1));
如何能把上面的语句替换到下面的$RS.Open("Select * From " & $_worklode_Table_complete)上呢?直接替换不行呢?Func _find()
GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $_my_worklode_accsee_complete)
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open("Select * From " & $_worklode_Table_complete)
While Not $RS.eof And Not $RS.bof
If @error = 1 Then ExitLoop
GUICtrlCreateListViewItem($RS.Fields(0).value & "|" & $RS.Fields(1).value, $ListView1)
$RS.movenext
WEnd
$RS.close
$addfld.Close
EndFunc
|