Ana içeriğe atla

Dosyadaki verileri tabloya aktarma


Option Compare Database

Sub akt()
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("Tablo1")
Open "d:\ak.txt" For Input As #1
Do While Not EOF(1)
rst.AddNew
Input #1, ad, soyad, yaş
rst("ad").Value = ad
rst("soyad").Value = soyad
rst("yaş").Value = yaş
rst.Update
Loop
Close #1
End Sub

Yorumlar

Bu blogdaki popüler yayınlar

Uygulama Sınavı S-1

İsmi A ile Başlayan Kişi Sayısı Option Compare Database Sub soru1() Dim db As Database Dim rst As Recordset Set db = CurrentDb Set rst = db.OpenRecordset("Tablo1") toplam = 0 Do Until rst.EOF If Left(rst.Fields("ad").Value, 1) = "a" Then toplam = toplam + 1 End If rst.MoveNext Loop MsgBox (toplam) End Sub

04.10.2011 2.ÖRNEK(Veri Tabanı)

04.10.2011 2.ÖRNEK Sub hesapla() For x = 1 To 10 ' burada D sütunun içine A sütunun ilk harfi ve nokta sonra B sütunun birleşmiş halidir. Cells(x, 4) = Left(Cells(x, 1), 1) & "." & " " & Cells(x, 2) ' burada E sütunun içine A sütunuyla B sütunun birleştirmiştir. Cells(x, 5) = Cells(x, 1) & "  " & Cells(x, 2) Next x End Sub

bir tablodan diğer bir tabloya veri aktarımı

Option Compare Database Dim db As Database Dim rst As Recordset Dim rs As Recordset2 Sub kayıt() Set db = CurrentDb() Set rst = db.OpenRecordset("tablo1") Set rs = db.OpenRecordset("yedek") Do Until rst.EOF rs.AddNew rs.Fields("isim").Value = rst.Fields("isim").Value rs.Update rst.MoveNext Loop End Sub