954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Code for Find First ...

Hi, friends!

Could somebody tell me what code should be written for the following buttons to search the database ( I am using ADODC CONTROL) :

Find First
Find Previous
Find Next
Find Last

I will be grateful for any response...

user777
Newbie Poster
19 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Dim Conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.open {Connection String}
rs.Open "Select * FROM TABLE;", Conn, 3, 3, 1

use only one of tehse under each correct button

rs.MoveFirst
rs.MovePrevious
rs.MoveNext
rs.MoveLast

jwshepherd
Junior Poster
123 posts since Jun 2005
Reputation Points: 20
Solved Threads: 5
 

Dim Conn As ADODB.Connection Dim rs As ADODB.Recordset Set Conn = New ADODB.Connection Set rs = New ADODB.Recordset conn.open {Connection String} rs.Open "Select * FROM TABLE;", Conn, 3, 3, 1

use only one of tehse under each correct button

rs.MoveFirst rs.MovePrevious rs.MoveNext rs.MoveLast

-------------------------------------------------------------------

Dear Sir,

Thanks for your kind reply. Could you please do me a another favour. Since I dont know where this code goes so I am sending this program in a zip format please modify it and send it back. Sorry to give you trouble.

Have a nice day.

Attachments CONTACTS.zip (17.29KB)
user777
Newbie Poster
19 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Dim Conn As ADODB.Connection Dim rs As ADODB.Recordset Set Conn = New ADODB.Connection Set rs = New ADODB.Recordset conn.open {Connection String} rs.Open "Select * FROM TABLE;", Conn, 3, 3, 1

use only one of tehse under each correct button

rs.MoveFirst rs.MovePrevious rs.MoveNext rs.MoveLast

----------------------------------------------------------------
Could you please re-write the code for me since I am a bit confused.

database path is : C:\CONTACTS (THE FOLDER NAME & DATABASE NAME ARE SAME I.E. CONTACTS)
table name is : CUSTOMERS

Thanks for any help.

user777
Newbie Poster
19 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You