تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[vb6.0] البحث في أكثر من جدول
#1
السلام عليكم
لدي سؤال عن كيفية البحث عن كلمة ما في اكثر من جدول وعرض النتائج في لست فيو
انا استحدم هذا الكود لكن اجده بطئ  هل يوجد طريقة آخرى
كود :
     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
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
البحث في أكثر من جدول - بواسطة أيمن الفخراني - 20-01-17, 04:31 PM
RE: البحث في أكثر من جدول - بواسطة Ahmed_Mansoor - 22-01-17, 11:13 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم