- Katılım
- 10 Ocak 2017
- Mesajlar
- 42
- Excel Vers. ve Dili
- 2013 Türkçe
- Altın Üyelik Bitiş Tarihi
- 16-10-2020
Vba ile sql sorgu yaparken sorgunun içine sıralama kodunu nasıl ekleyebilirim ?
Mevcut sorgum:
Bu sorguda rs.open çalışıyor.
Ama rs2.open sorgusu çalışmıyor. Rs2 sorgusunda order by nufus syntax ının muhtemelen yanlış yazıyorum, doğrusunu nasıl yazabilirim ?
Yani sorguda hem txtOlcut kriterlerine göre sorgu yapsın ve bunu nufus a göre sıralasın !
yardımcı olabilir misiniz?
Mevcut sorgum:
Kod:
If Me.OptionButton23 = True Then txtOlcut = txtOlcut & " and asfalt='Var'"
If Me.OptionButton24 = True Then txtOlcut = txtOlcut & " and asfalt='Yok'"
txtOlcut = Mid(txtOlcut, 5)
rs.Open "select * from envanter order by nufus ", baglan, adOpenKeyset, adLockPessimistic
rs2.Open "select * from envanter where " & txtOlcut order by nufus ", baglan, adOpenKeyset, adLockPessimistic
Ama rs2.open sorgusu çalışmıyor. Rs2 sorgusunda order by nufus syntax ının muhtemelen yanlış yazıyorum, doğrusunu nasıl yazabilirim ?
Yani sorguda hem txtOlcut kriterlerine göre sorgu yapsın ve bunu nufus a göre sıralasın !
yardımcı olabilir misiniz?