I.T. Discussion Community!
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

Advanced
-Collapse +Expand ASP Classic Store
   ► KBTo/From GuidesASP ClassicDatabase  Print This    All Groups  

ASP Classic Database

Find Record

Languages Focus

Finding a record is about moving a cursor to a specific record within a set of records (documented here). In addition to finding a record, you can sort, filter, and loop a set of records (documented in their topics).

ASP Classic:   Find, Seek

In ASP, using ADO, you use Find and Seek to move a cursor of a RecordSet to a matching record.

Syntax Example:

Given a valid ADO recordset, the following code snippet finds a specific user and prints out their age:

TC.Find " UserID='mprestwood' "
Response.Write TC.Fields("Age")




Cross Reference Examples:

Corel Paradox:   locate, qLocate

ObjectPAL provides a rich set of commands for finding a record with a TCursor or UIObject including:

  • locate() -  Seach for a value based on a criteria. Uses indexes as appropriate.
  • locatePattern() - Search for a pattern within a value.
  • moveToRecord() - Moves to a specific record number.
  • qLocate() - Search using currently set index.

Each of these basic find record commands has supporting commands such as locateNext() and recNo().

Syntax Example:
var
  tc TCursor
endVar
   
tc.open("Customer.db") 
if tc.locate("Name", "Proffessional Divers, Ltd.") then 
  tc.edit()
  tc.Name = "Professional Divers, Ltd."
  msgInfo("Success", "Corrected spelling error.")
endIf
tc.endEdit()





Follow PrestwoodBoards on: 


©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech