# Re: VB recordset SQL return code

Posted by 纪文和 on June 17, 1998 at 05:21:13:

In Reply to: Re: VB recordset SQL return code posted by David Wong on June 17, 1998 at 01:58:04:

若您要用 Execute 算出 Select 恐怕不行, 若是 Action Query 可用
Db.RecordsAffected 算出.

用 ExecuteSQL Method 是可以算笔数的, 但是也只能用在 Action Query,
即 Delete/Update..., 而 Select 是算不出来的. (传回值即笔数)

您若用以下方法也可以:
Dim ss as snapshot
Set ss = db.createsnapshot("select * from staff where staff_code = 'A'")
if ss.recordcount = 0 then
资料笔数 = 0笔
else
ss.movenext
资料笔数 = ss.recordcount
end if

Follow Ups:

- Re: VB recordset SQL return code David Wong 02:42:05 6/18/98 (0)
- Re: VB recordset SQL return code David Wong 02:41:40 6/18/98 (0)
- Re: VB recordset SQL return code David Wong 20:28:20 6/17/98 (0)