ADODC Search code

Reply

Join Date: May 2007
Posts: 3
Reputation: cybuster is an unknown quantity at this point 
Solved Threads: 1
cybuster's Avatar
cybuster cybuster is offline Offline
Newbie Poster

ADODC Search code

 
0
  #1
May 15th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 59
Reputation: PVBert is an unknown quantity at this point 
Solved Threads: 5
PVBert PVBert is offline Offline
Junior Poster in Training

Re: ADODC Search code

 
0
  #2
May 17th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 216
Reputation: jamello is an unknown quantity at this point 
Solved Threads: 6
jamello's Avatar
jamello jamello is offline Offline
Posting Whiz in Training

Re: ADODC Search code

 
0
  #3
May 17th, 2007
Originally Posted by cybuster View Post
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.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. adcBrowser.Recordset.Find txtSearchHdr.Text & " like '" & txtSearch & "_'", , adSearchForward
  2. 'adcBrowser is the name of your ADODC
  3. 'txtSearchHdr.Text is your recordset field
  4. '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.
Last edited by jamello; May 17th, 2007 at 7:06 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 13
Reputation: ahmed elweshahy is an unknown quantity at this point 
Solved Threads: 0
ahmed elweshahy's Avatar
ahmed elweshahy ahmed elweshahy is offline Offline
Newbie Poster

Re: ADODC Search code

 
0
  #4
May 19th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 59
Reputation: PVBert is an unknown quantity at this point 
Solved Threads: 5
PVBert PVBert is offline Offline
Junior Poster in Training

Re: ADODC Search code

 
0
  #5
May 20th, 2007
The .nomatch property doesn't exist in ADO.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 2
Reputation: mivc is an unknown quantity at this point 
Solved Threads: 0
mivc mivc is offline Offline
Newbie Poster

Re: ADODC Search code

 
0
  #6
Jun 8th, 2007
Remember that you can only search on 1 field with the FindFirst method.

The following code will not work;

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. rs.findfirst "NAME=" & 'NAME' & " AND POBOX=" & '2300 PD'
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 59
Reputation: PVBert is an unknown quantity at this point 
Solved Threads: 5
PVBert PVBert is offline Offline
Junior Poster in Training

Re: ADODC Search code

 
0
  #7
Jun 8th, 2007
findfirst doesn't exist at all, so even searching on one field won't go
you can you select statements and use:

  1. Dim cn As ADODB.Connection
  2. Dim cmd As ADODB.Command
  3. Dim rs As ADODB.Recordset
  4.  
  5. Set cn = New ADODB.Connection
  6. Set cmd = New ADODB.Command
  7. Set rs = New ADODB.Recordset
  8.  
  9. ' Open the Connection object
  10. cmd.ActiveConnection = cn
  11.  
  12. cmd.CommandText = "select "
  13. cmd.Execute
  14.  
  15. ' Open a Recordset object on the new table.
  16. cmd.CommandText = "SELECT * FROM YOURTABLENAME WHERE YOURFIELDNAME = 'YOURVALUE' "
  17.  
  18. ' "SELECT * FROM YOURTABLENAME WHERE YOURFIELDNAME = 'YOURVALUE' AND YOUROTHERFIELDNAME = 'ANOTHERVALUE' "
  19.  
  20. Set rs = cmd.Execute()
  21.  
  22. rs.Close
  23. cn.Close
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC