|
|
|
|
你现在的位置:您现在的位置是: 中国ASP>>数据库>>access |
|
| 一句代码得到表中的某行的指定字段 |
|
一般情况下我们使用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") '----------------------
这个方法中隐式创建了一个ADO的记录集,并使用了记录集的GETSTRING或字段索引的方法得到结果注意:条件字段必须是主键(不重复)
|
|
|