看看msdn,很详细的!
ADO 2.7 API Reference See Also
Visual Basic ExampleIndex Property | Optimize Property—Dynamic (ADO) | Seek MethodApplies To: Recordset Object
Find Method
Searches a Recordset for the row that satisfies the specified criteria. Optionally, the direction of the search, starting row, and offset from the starting row may be specified. If the criteria is met, the current row position is set on the found record; otherwise, the position is set to the end (or start) of the Recordset.Syntax
Find (Criteria, SkipRows, SearchDirection, Start)
Parameters
Criteria
A String value that contains a statement specifying the column name, comparison operator, and value to use in the search.
SkipRows
Optional. A Long value, whose default value is zero, that specifies the row offset from the current row or Start book to begin the search. By default, the search will start on the current row.
SearchDirection
Optional. A SearchDirectionEnum value that specifies whether the search should begin on the current row or the next available row in the direction of the search. An unsuccessful search stops at the end of the Recordset if the value is adSearchForward. An unsuccessful search stops at the start of the Recordset if the value is adSearchBackward.
Start
Optional. A Variant book that functions as the starting position for the search.
Res
Only a single-column name may be specified in criteria. This method does not support multi-column searches.The comparison operator in Criteria may be ">" (greater than), "<" (less than), "=" (equal), ">=" (greater than or equal), "<=" (less than or equal), "<>" (not equal), or "like" (pattern matching).The value in Criteria may be a string, floating-point number, or date. String values are delimited with single quotes or "#" (number sign) s (for example, "state = 'WA'" or "state = #WA#"). Date values are delimited with "#" (number sign) s (for example, "start_date > #7/22/97#").If the comparison operator is "like", the string value may contain an asterisk (*) to find one or more occurrences of any character or substring. For example, "state like 'M*'" matches Maine and Massachusetts. You can also use leading and trailing asterisks to find a substring contained within the values. For example, "state like '*as*'" matches Alaska, Arkansas, and Massachusetts.Asterisks can be used only at the end of a criteria string, or together at both the beginning and end of a criteria string, as shown above. You cannot use the asterisk as a leading wildcard ('*str'), or embedded wildcard ('s*r'). This will cause an error.Note An error will occur if a current row position is not set before calling Find. Any method that sets row position, such as MoveFirst, should be called before calling Find.
ADO 2.7 API Reference See Also
Visual Basic ExampleIndex Property | Optimize Property—Dynamic (ADO) | Seek MethodApplies To: Recordset Object
Find Method
Searches a Recordset for the row that satisfies the specified criteria. Optionally, the direction of the search, starting row, and offset from the starting row may be specified. If the criteria is met, the current row position is set on the found record; otherwise, the position is set to the end (or start) of the Recordset.Syntax
Find (Criteria, SkipRows, SearchDirection, Start)
Parameters
Criteria
A String value that contains a statement specifying the column name, comparison operator, and value to use in the search.
SkipRows
Optional. A Long value, whose default value is zero, that specifies the row offset from the current row or Start book to begin the search. By default, the search will start on the current row.
SearchDirection
Optional. A SearchDirectionEnum value that specifies whether the search should begin on the current row or the next available row in the direction of the search. An unsuccessful search stops at the end of the Recordset if the value is adSearchForward. An unsuccessful search stops at the start of the Recordset if the value is adSearchBackward.
Start
Optional. A Variant book that functions as the starting position for the search.
Res
Only a single-column name may be specified in criteria. This method does not support multi-column searches.The comparison operator in Criteria may be ">" (greater than), "<" (less than), "=" (equal), ">=" (greater than or equal), "<=" (less than or equal), "<>" (not equal), or "like" (pattern matching).The value in Criteria may be a string, floating-point number, or date. String values are delimited with single quotes or "#" (number sign) s (for example, "state = 'WA'" or "state = #WA#"). Date values are delimited with "#" (number sign) s (for example, "start_date > #7/22/97#").If the comparison operator is "like", the string value may contain an asterisk (*) to find one or more occurrences of any character or substring. For example, "state like 'M*'" matches Maine and Massachusetts. You can also use leading and trailing asterisks to find a substring contained within the values. For example, "state like '*as*'" matches Alaska, Arkansas, and Massachusetts.Asterisks can be used only at the end of a criteria string, or together at both the beginning and end of a criteria string, as shown above. You cannot use the asterisk as a leading wildcard ('*str'), or embedded wildcard ('s*r'). This will cause an error.Note An error will occur if a current row position is not set before calling Find. Any method that sets row position, such as MoveFirst, should be called before calling Find.
解决方案 »
- 小小函数实现,来看看吧
- 关于在视图中显示图形的问题
- vc 如何实现sql server的增量备份?
- 想找一个c++的工作,怎么这么难找,现在用c++的真是越来越少了
- 高分求答案,语法编译出错,急!!!
- 在VC中如何实现光盘刻录?我不是求代码,只是请各位路过的大侠提供一个解决问题的方向.
- 救命啊,谁能帮我解惑? 关于XML在VC.Net中的使用
- 请问vc++怎样编程才能对并行口数据线控制?具体的程序怎样编?
- 一个写文件的问题,知者不难!请指教!
- DAO、ADO、ODBC他们三各有什么特点?
- 請各位大蝦指教,我有一個很奇怪的問題(關於ATL開發的Service服務)!
- 有关CFtpFileFind的奇怪问题!
谢谢你!