Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help with adodc.recordset.find

Status
Not open for further replies.

spykat19

Programmer
Feb 20, 2009
1
Please, can someone explain the meaning and syntax of the find function

adodc1.recordset.find(arguments explanation with example)

.Thank you
 
Dim objConn As New ADODB.Connection
Dim objRS As New ADODB.Recordset
Dim objCmd As New ADODB.Command
Dim tblName1 As String

objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ACCESS\CostCtr.mdb;Persist Security Info=False")
'objRS.CursorType = adOpenDynamic
objRS.LockType = ADODB.LockTypeEnum.adLockOptimistic
objRS.CursorType = ADODB.CursorTypeEnum.adOpenDynamic

'setting the Active Connection for the command object
objCmd.let_ActiveConnection(objConn)

tblName1 = "COST_WORK_TABLE"
objRS.Open(tblName1, objConn, , , ADODB.CommandTypeEnum.adCmdTable)

objRS.Find("KEY = '" & strKey & "'")

In the table the recordset has a field called Key which contains the employee ID. This is doing a search of the contents of Key and finding a match to strKey. StrKey is a string field that contains the employee's ID.

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top