1,105,263 Community Members

ADODC Search code

Member Avatar
cybuster
Newbie Poster
3 posts since May 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

hi im just starting to design a database using adodc but I have a problem...

can someone give me tip on how to create a search code for ADODC... thx in advance

Member Avatar
PVBert
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

I don't get it. Don't you have google?

In 1 second I got this result.
Look here: http://hamilton.bell.ac.uk/swdev1/notes_pp1_5.doc

I just searched on: +adodc +recordset +select
You can also try to seach on: +adodc +recordset +find

Member Avatar
jamello
Posting Whiz in Training
219 posts since Oct 2006
Reputation Points: 158 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
-1
 

hi im just starting to design a database using adodc but I have a problem...

can someone give me tip on how to create a search code for ADODC... thx in advance

Try the following code.

adcBrowser.Recordset.Find txtSearchHdr.Text & "  like '" & txtSearch & "_'", , adSearchForward
'adcBrowser is the name of your ADODC
'txtSearchHdr.Text is your recordset field
'txtSearch is your search criteria

if you want to search for a hypothetic recordset field sname for "surname"
begining with "dav" then txtSearchHdr.Text is sname
and txtSearch is dav

adSearchForward or adSearchBackward can be used.

Member Avatar
ahmed elweshahy
Newbie Poster
18 posts since Apr 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

re as recordset
dim x as string
x=inputbox("enter the name please :")
re.findfirst"name=' " & x & " ' "
if re.nomatch then
msgbox "the name You Entered not found"
end if

Member Avatar
PVBert
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

The .nomatch property doesn't exist in ADO.

Member Avatar
mivc
Newbie Poster
2 posts since Jun 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Remember that you can only search on 1 field with the FindFirst method.

The following code will not work;

rs.findfirst "NAME=" & 'NAME' & " AND POBOX=" & '2300 PD'
Member Avatar
PVBert
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

findfirst doesn't exist at all, so even searching on one field won't go
you can you select statements and use:

Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
 
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset
        
' Open the Connection object    
 cmd.ActiveConnection = cn
    
cmd.CommandText = "select "
cmd.Execute
    
' Open a Recordset object on the new table.
cmd.CommandText = "SELECT * FROM YOURTABLENAME WHERE YOURFIELDNAME = 'YOURVALUE' "
 
' "SELECT * FROM YOURTABLENAME WHERE YOURFIELDNAME = 'YOURVALUE'  AND YOUROTHERFIELDNAME = 'ANOTHERVALUE' "

Set rs = cmd.Execute()

rs.Close
cn.Close
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article