please help me..
i want know the coding searching..
how can find search coding in vb 6.0?
Are you talking about searching specific data in a database?
Please tell us more in specifics on what you need to search for.
need more information. what kind of search you want? from database, from text file or other?
i want to know how to create a search code for ADODC??
Well, there is quite a few ways depending on WHAT you want to search for. Below is a few samples -
rs.Open "Select FirstName,LastName,Balance from Patients Where Balance > 0", cn, adOpenKeyset, adLockOptimistic 'Will search for a monetary value. rs.Open "Select FirstName,LastName,Gender,City,ID from Patients Where Gender='Female' and City='Cape Town'", cn, adOpenKeyset, adLockOptimistic 'Will search for a gender or city rs.Open "Select FirstName,LastName,FirstVisitDate from Patients Where FirstVisitDate >= DateValue('1/1/2009')", cn, adOpenKeyset, adLockOptimistic 'Will search for a specific date. rs.Open "Select * from Patients Where left(FirstName,1)='E'", cn, adOpenKeyset, adLockOptimistic 'Will search for all names starting with "E". rs.Open "Select FirstName,LastName,Diagnosis from Patients", cn, adOpenKeyset, adLockOptimistic rs.Filter = "Diagnosis Like '*Stomach Pain*'" 'Will search for any name where either stomach or pain is in the data.
I hope this helps in searching for the correct data.
Hi soilarmoon, may also use this code from this site
Hopefully it may help.
On Error GoTo errHandler
mSQL = “Select Code,Name,Address From Supplier Where Code Like ‘%” & text1 & “%’ Or Name Like ‘%” & text1 & “%’ ” & _
” Or Address Like ‘%” & t & “%’ Order by Name Asc ”
Adodc1.ConnectionString = ConStr
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = mSQL
Set dg1.DataSource = Adodc1
cmdOK.Enabled = True
If Adodc1.Recordset.BOF And Adodc1.Recordset.EOF Then
cmdOK.Enabled = False
MsgBox CStr(Err.Number) + Err.Description