DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub CommandButton2_Click()
Dim baglan as object
Set baglan = CreateObject("adodb.connection")
baglan.Open "provider=microsoft.jet.oledb.4.0;data source=C:\ogrenci.mdb"
Set baglan = Nothing
End Sub
Private Sub CommandButton2_Click()
Dim baglan As ADODB.Connection
Set baglan = New ADODB.Connection
baglanti = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ogrenci.mdb"
baglan.Open baglanti
Set baglan = Nothing
End Sub
Private Sub UserForm_Initialize()
Dim con As Object, rs As Object
Set con = CreateObject("adodb.connection")
dosya = "C:\ogrenci.mdb"
con.Open "provider=microsoft.jet.oledb.4.0;data source=" & dosya
Set rs = con.Execute("select * from ogrenci_tablo Order By id")
With ListBox1
.Clear
.ColumnCount = 6
.ColumnWidths = "20;50;60;60;60;0"
.Column = rs.GetRows
Label5.Caption = .ListCount
End With
Set rs = Nothing: Set con = Nothing
End Sub
Private Sub CommandButton1_Click()
Application.EnableEvents = False
yol = MsgBox("Seçim Yapılsın mı ?", vbYesNo, Application.UserName)
If yol = vbNo Then Exit Sub
If yol = vbYes Then
evn = Application.GetOpenFilename(Filefilter:="Resim Dosyaları,*.jpg;*.bmp", Title:="Resim Seçimi")
If evn = False Then Exit Sub
TextBox5.Text = evn
Image1.Picture = LoadPicture(TextBox5.Value)
End If
Application.EnableEvents = True
End Sub
Private Sub CommandButton2_Click()
Dim evn As Object, rs As Object
Set evn = CreateObject("adodb.connection")
dosya = "C:\ogrenci.mdb"
evn.Open "provider=microsoft.jet.oledb.4.0;data source=" & dosya
Set rs = CreateObject("adodb.recordset")
rs.Open "select * from ogrenci_tablo", evn, 1, 3
rs.addnew
rs.fields("isim").Value = TextBox1.Value
rs.fields("soyisim").Value = TextBox2.Value
rs.fields("kursu").Value = TextBox3.Value
rs.fields("bitistarihi").Value = TextBox4.Value
rs.fields("Resim").Value = TextBox5.Value
rs.Update
MsgBox "Bilgiler veritabanına kaydedilmiştir. ", vbInformation, Application.UserName
TextBox1.Text = "": TextBox2.Text = ""
TextBox3.Text = "": TextBox4.Text = "": TextBox5.Text = ""
rs.Close
evn.Close
UserForm_Initialize
End Sub
Private Sub ListBox1_Click()
With ListBox1
TextBox1.Value = .Column(1)
TextBox2.Value = .Column(2)
TextBox3.Value = .Column(3)
TextBox4.Value = .Column(4)
TextBox5.Value = .Column(5)
If TextBox5.Value = "" Then
Set Image1.Picture = Nothing
'MsgBox "Resim Yok"
Else
Image1.Picture = LoadPicture(TextBox5.Text)
End If
End With
End Sub
Private Sub TextBox1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text = "": TextBox2.Text = ""
TextBox3.Text = "": TextBox4.Text = "": TextBox5.Text = ""
End Sub
dosya = "C:\ogrenci.accdb"
con.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dosya