22-10-12, 11:44 AM
PHP كود :
'للبحث بالاسم
Adodc1.RecordSource = " select * from TB1 where Name = '" & Text1.Text & "' "
Adodc1.CommandType = adCmdText
Adodc1.Refresh
'للبحث بالرقم
Adodc1.RecordSource = " select * from TB1 where NO= " & Text1.Text & " "
Adodc1.CommandType = adCmdText
Adodc1.Refresh
'للبحث بجزء من الاسم
Adodc1.RecordSource = " select * from TB1 where Name like '" & Text1.Text &"*" & "' "
Adodc1.CommandType = adCmdText
Adodc1.Refresh
'للبحث بجزء من الرقم
Adodc1.RecordSource = " select * from TB1 where NO like " & Text1.Text & "*" & " "
Adodc1.CommandType = adCmdText
Adodc1.Refresh
'طريقه أخرى
للبحث بالحرف
set cn = new adodb.connection
cn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\db1.mdb"
If RS.State = 1 Then RS.state= close
RS.Open " select * from t1 where name like '" & text1.text & "*" & "' " , cn , adopenkeyset, adlockoptimistic
