21/12/2013, 20:34
Aşağıdaki kodu VB.net koduna nasıl çevirebilirim,yardımcı olabilirmisiniz.
Sub Baglanti()
baglan = CreateObject("adodb.connection")
baglan.Open "provider=microsoft.jet.oledb.4.0;data source="kayıt.mdb"
End Sub
Private Sub ComboBox100_Change()
Call guncelle(100)
End Sub
Sub guncelle(nesne As Integer) ' comboboxtan comboboxa veri aktarma kodu ( bağlantılı combobox )
On Local Error Resume Next
Dim alan, s
For i = 100 To 103
If i <> nesne Then
alan = Controls("ComboBox" & i).Tag
s = "select " & alan & " from [Kayitlar] where not isnull(" & alan & ")"
If ComboBox100.Text <> "" Then s = s & " and [TckimlikNo] like '" & ComboBox100.Text & "%'"
If ComboBox101.Text <> "" Then s = s & " and [BabaAdi] like '" & ComboBox101.Text & "%'"
If ComboBox102.Text <> "" Then s = s & " and [Ogrencino] like '" & ComboBox102.Text & "%'"
s = s & " group by " & alan
baglan = CreateObject("adodb.connection")
rs = CreateObject("adodb.recordset")
Call Baglanti()
rs.Open(s, baglan, 1, 1)
If rs.RecordCount > 0 Then
Controls("ComboBox" & i).Column = rs.getrows
End If
End If
Next i
End Sub