一句代码得到表中的某行的指定字段另类方法


一般情况下我们使用DLOOKUP,或才ADO,DAO来读取记录,这样我们来个比较特殊的用法得到录:

dim strname as string

'方法一:
strname = currentproject.connection.execute("select name from emplyees where id =3").getstring

'方法二:
strname = currentproject.Connection.Execute("("select name from emplyees where id =3")("name")
'----------------------

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus