General information
Category:
Database DAO/RDO/ODBC/ADO
Hi All:
I need help using the seek command. Below is my code that I am using to seek a specific record in my recordset.
Set oDataComm = New ADODB.Connection
oDataComm.ConnectionString = "DSN=ctcore"
oDataComm.Open
'This is what I have in my load function
Set oRecSet = New ADODB.Recordset
Set oRecSet.ActiveConnection = oDataConn
oRecSet.CursorLocation = adUseClient
oRecSet.CursorType = adOpenStatic
oRecSet.Open "SELECT * FROM Phone", oDataComm
'This is what I have in my Find command button
strPrompt = "Enter an Phone"
strID = LCase(Trim(InputBox(strPrompt, "Seek Phone")))
If oRecSet.Supports(adIndex) And oRecSet.Supports(adSeek) Then
oRecSet.Index = "PrimaryKey"
oRecSet.Seek Array(strID), adSeekFirstEQ
If oRecSet.EOF Then
Debug.Print "Phone not found.", , "Seek Example"
MsgBox "Phone not found."
End If
End If
When I click on my Find command button, I get an error. The error is as follow: "Method or data memeber is not found."
Please tell me what am I doing wrong?
Thanks for all of your help!!!
MA
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only