Archive

Archive for the ‘Visual Basic’ Category

getSentence() dan getWord()


getSentence() dan getWord() merupakan fungsi untuk mendapatkan ejaan dari suatu bilangan.

Function getWord(digit As Integer) As String
    If digit = 1 Then
        getWord = "se"
    ElseIf digit = 2 Then
        getWord = "dua "
    ElseIf digit = 3 Then
        getWord = "tiga "
    ElseIf digit = 4 Then
        getWord = "empat "
    ElseIf digit = 5 Then
        getWord = "lima "
    ElseIf digit = 6 Then
        getWord = "enam "
    ElseIf digit = 7 Then
        getWord = "tujuh "
    ElseIf digit = 8 Then
        getWord = "delapan "
    ElseIf digit = 9 Then
        getWord = "sembilan "
    End If
End Function

Read more…

Categories: Visual Basic Tags:

getButtons() dan getButton()

20100521 1 comment

getButtons() dan getButton() merupakan fungsi untuk mendapatkan tombol yang digunakan untuk menulis suatu kata.

Function getButton(character As String) As String
    character = UCase(character)
    If character >= "A" And character <= "C" Then
        getButton = "2"
    ElseIf character >= "D" And character <= "F" Then
        getButton = "3"
    ElseIf character >= "G" And character <= "I" Then
        getButton = "4"
    ElseIf character >= "J" And character <= "L" Then
        getButton = "5"
    ElseIf character >= "M" And character <= "O" Then
        getButton = "6"
    ElseIf character >= "P" And character <= "S" Then
        getButton = "7"
    ElseIf character >= "T" And character <= "V" Then
        getButton = "8"
    ElseIf character >= "W" And character <= "Z" Then
        getButton = "9"
    End If
End Function

Read more…

Categories: Visual Basic Tags:

Koneksi String Visual Basic – mySQL


Berikut ini contoh Koneksi String Visual Basic – mySQL berserta CRUDE-nya

Public koneksi As ADODB.Connection
Public koneksiString As String
Public hasil As ADODB.Recordset
Public SQL As String

Public Sub openKoneksi()
    On Error GoTo err
    Dim server As String
    Dim port As String
    Dim database As String
    Dim User As String
    Dim password As String

Read more…

Categories: Visual Basic Tags:

Koneksi String Visual Basic – mdb (Access)


Public Koneksi As New ADODB.Connection
Public rst As New ADODB.Recordset
Public rst2 As New ADODB.Recordset
Public strSQL, strSQL2 As String

Public Sub BukaKoneksi()
    Dim strKoneksi As String
    strKoneksi = "Provider=Microsoft.Jet.OLEDB.4.0;" &amp; _
                 "Data Source= " &amp; App.Path &amp; "\AnekaJaya2.mdb;" &amp; _
                 "Persist Security Info=False"
    If Koneksi.Mode &gt; 0 Then Koneksi.Close
    Koneksi.Open strKoneksi
End Sub

Public Sub TutupKoneksi()
    Koneksi.Close
End Sub

Semoga membantu..

Categories: Visual Basic Tags:
%d bloggers like this: