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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I search for records in my database using ADO?

Status
Not open for further replies.

giggs11

Programmer
Dec 5, 2001
21
CA
I have a Sales table with fields Agentname, Date, CustomerName, Account Number, ProductCode and Dollar. Using ADO, how do i search by Agent name and have all the Agent's Sales for the day displayed?
 
Try something like

(I assume here that conn is your ado connection)

Dim rs as adodb.recordset
Dim sqlStr as String

sqlString = "Select * Sales where agentname = '" & agentname & "' And [date] = '" & Date & "'"
rs.open sqlstring, conn, adopenstatic, adlockoptimistic, adcmdtext Mark

The key to immortality is to make a big impression in this life!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top