Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Gambas class file
- Private koneksi As New Connection
- qry As String
- rs As Result
- Sub konek_db()
- With koneksi
- .Type = "mysql"
- .host = "localhost"
- .user = "root"
- .password = "12345"
- .name = "akademik"
- End With
- End
- Public Sub Form_Open()
- koneksi = New Connection
- End
- Public Sub Form_Close()
- koneksi.Close
- End
- Public Sub SIMPAN_Click()
- Try koneksi.Close
- konek_db()
- koneksi.Open
- qry = "insert into mahasiswa values ('" & TextBox1.Text & "','" & TextBox2.Text & "', '" & TextArea1.text & "')"
- rs = koneksi.Exec(qry)
- If Not Error Then
- Message.Info("sukses")
- Endif
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement