تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[vb6.0] البحث في أكثر من جدول
#3
وعليكم السلام ورحمة الله وبركاته

أهلا بك أخي الكريم , هذا تعديل لجملة الإستعلام ليختصر عليك الكود المكرر :

PHP كود :
If MB.state 1 Then MB.Close
MB
.Open "select nass,'كتاب1' as zTitle from table1 where nass like '%" Text1.Text "%'" _
        
" UNION " _
        
"select nass,'كتاب2' as zTitle from table2 where nass like '%" Text1.Text "%'" _
        
" UNION " _
        
"select nass,'كتاب3' as zTitle from table3 where nass like '%" Text1.Text "%'" _
        
" Order By zTitle,nass"DBadOpenStaticadLockReadOnly

If MB.RecordCount 0 Then
   
   MB
.MoveFirst
   
   
Do While Not MB.EOF
      Set lst 
ListView1.ListItems.Add(, , MB!nass)
      
lst.SubItems(1) = MB!zTitle
      MB
.MoveNext
      DoEvents
   Loop
   
End 
If

If 
MB.state 1 Then MB.Close 
الرد }}}


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


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


يقوم بقرائة الموضوع: