0% found this document useful (0 votes)
5 views2 pages

Export Student Data to Text File

The document contains code to export student data from a database to a text file. It opens a file, queries the database to get student records with names, addresses, religions, courses and grades. It then loops through the records, writing the data to the file with tabs, and calculates a total grade average. Header and footer subroutines format the output.

Uploaded by

yannie_awan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Export Student Data to Text File

The document contains code to export student data from a database to a text file. It opens a file, queries the database to get student records with names, addresses, religions, courses and grades. It then loops through the records, writing the data to the file with tabs, and calculates a total grade average. Header and footer subroutines format the output.

Uploaded by

yannie_awan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Private Sub Command1_Click()

Open "D:\kamtis hebring\target\[Link]" For Output As #1


[Link] = "SELECT [Link], [Link],
[Link], [Link], [Link], [Link] FROM mahasiswa
INNER JOIN Nilai ON [Link] = [Link]"
[Link]
If [Link] > 0 Then
[Link]
[Link]
header
VJML = 0
For i = 1 To [Link]
VJML = VJML + ([Link](5)) / ([Link])
Print #1, Tab(1); "|"; [Link](0); Tab(15); "|"; Tab(16);
[Link](1); Tab(35); "|"; Tab(36); [Link](2); Tab(57); "|";
Tab(58); [Link](3); Tab(72); "|"; Tab(73); [Link](4); Tab(87);
"|"; Tab(88); [Link](5); Tab(97); "|"
[Link]
Next i
footer
Print #1, "jumlan nilai semua:"; VJML
Close #1
[Link] = "D:\kamtis hebring\target\[Link]"
Else
MsgBox ("data kosong")
End If
End Sub
Sub header()
Print #1, Tab(22); "AKADEMIK MANAJENEN INFORMATIKA"
Print #1, Tab(29); "AMIK PGRI KEBUMEN"
Print #1, Tab(24); "[Link] NO 26.A KEBUMEN"
'
12345678901234567890123456789012345678901234567890123456789012345678901
23456789012345678901234567890
' 10 20 30 40 50 60 70 80 90 100
Print #1,
"===============================================================
=================================="
Print #1, "|NIM |NAMA |ALAMAT |AGAMA |MAPEL |
NILAI |"
Print #1,
"===============================================================
=================================="
End Sub
Sub footer()
Print #1,
"===============================================================
=================================="

End Sub

You might also like