如下语句:
ThRs.Open "select top 1 Thtmmx.id,Thtmmx.Thid,Productset.productid,thtmmx.txm,productset.productname,Thtmmx.thdays from Thtmmx,Cktmmx,productset where thtmmx.txm=cktmmx.txm and cktmmx.productid=productset.productid and Thtmmx.Thid=" & ThId & " order by Thtmmx.id desc", db, adOpenDynamic, adLockOptimistic最后得到的还是多条记录.不知道为什么?
ThRs.Open "select top 1 Thtmmx.id,Thtmmx.Thid,Productset.productid,thtmmx.txm,productset.productname,Thtmmx.thdays from Thtmmx,Cktmmx,productset where thtmmx.txm=cktmmx.txm and cktmmx.productid=productset.productid and Thtmmx.Thid=" & ThId & " order by Thtmmx.id desc", db, adOpenDynamic, adLockOptimistic最后得到的还是多条记录.不知道为什么?
在试试或者
set thrs = nothing 一下
在试试应该不会啊
2,实在不行,就不用top1,得到记录集合以后move.first得到第一个记录集合