20-01-17, 04:31 PM
السلام عليكم
لدي سؤال عن كيفية البحث عن كلمة ما في اكثر من جدول وعرض النتائج في لست فيو
انا استحدم هذا الكود لكن اجده بطئ هل يوجد طريقة آخرى
لدي سؤال عن كيفية البحث عن كلمة ما في اكثر من جدول وعرض النتائج في لست فيو
انا استحدم هذا الكود لكن اجده بطئ هل يوجد طريقة آخرى
كود :
If MB.state = 1 Then MB.Close
MB.Open "select * from table1 where nass like '%" & Text1.text & "%'", DB, adOpenStatic, adLockReadOnly
If MB.RecordCount > 0 Then
Do While Not MB.EOF
Set lst = ListView1.ListItems.add(, , MB!nass)
lst.SubItems(1) = "كتاب 1"
MB.MoveNext
DoEvents
Loop
MB.Close
End If
If MB.state = 1 Then MB.Close
MB.Open "select * from table2 where nass like '%" & Text1.text & "%'", DB, adOpenStatic, adLockReadOnly
If MB.RecordCount > 0 Then
Do While Not MB.EOF
Set lst = ListView1.ListItems.add(, , MB!nass)
lst.SubItems(1) = "كتاب 2"
MB.MoveNext
DoEvents
Loop
MB.Close
End If
If MB.state = 1 Then MB.Close
MB.Open "select * from table3 where nass like '%" & Text1.text & "%'", DB, adOpenStatic, adLockReadOnly
If MB.RecordCount > 0 Then
Do While Not MB.EOF
Set lst = ListView1.ListItems.add(, , MB!nass)
lst.SubItems(1) = "كتاب 3"
MB.MoveNext
DoEvents
Loop
MB.Close
End If