SHARE
TWEET

Untitled

a guest May 19th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public koneksi As ADODB.Connection
  2. Public rs As ADODB.Recordset
  3. Public rs1 As ADODB.Recordset
  4. Public rs2 As ADODB.Recordset
  5. Public rs3 As ADODB.Recordset
  6. Public rs4 As ADODB.Recordset
  7. Public rs5 As ADODB.Recordset
  8. Public rs0 As ADODB.Recordset
  9. Public rsJual As ADODB.Recordset
  10. Public rsStok As ADODB.Recordset
  11. Public disc As String
  12. Public sql As String
  13. Public pesan As VbMsgBoxResult
  14. Public sLama As String
  15. Public total As String
  16. Public sBaru As String
  17. Public aUser As String
  18. Public tanggal As String
  19. Public tmpGrand As String
  20. Public tmpDisc As String
  21. Public tmpNama As String
  22. Public tmpharga As String
  23. Public tmpModal As String
  24. Public tmpStok As String
  25. Public tmpUnit As String
  26. Public jam As String
  27. Public st As String
  28. Public bon As String
  29. Public Snama As String
  30. Dim edp As String
  31. Dim dbhost As String
  32. Dim dbname As String
  33. Dim dbuser As String
  34. Dim dbpwd As String
  35. Public id As String
  36. Public bln As String
  37. Public Sub Tunda(ByVal dtk As Single)
  38. Dim awal As Variant
  39. awal = Timer
  40. Do While Timer < awal + dtk
  41.     DoEvents
  42. Loop
  43. End Sub
  44.  
  45. Public Sub bukakoneksi_DSN()
  46. On Error GoTo handle
  47. Set koneksi = New ADODB.Connection
  48. koneksi.Open "dedyjaya"
  49. Exit Sub
  50. handle:
  51. MsgBox "Buatkan dsn connections dengan nama dedyjaya"
  52. Exit Sub
  53.  
  54. End Sub
  55. Public Sub bukaKoneksi()
  56. On Error GoTo handle
  57.     If GetSetting(App.CompanyName, App.EXEName, "konfig") = "manual" Then
  58.         Set koneksi = New ADODB.Connection
  59.         dbhost = GetSetting(App.CompanyName, App.EXEName, "dbhost")
  60.         dbname = GetSetting(App.CompanyName, App.EXEName, "dbname")
  61.         dbuser = GetSetting(App.CompanyName, App.EXEName, "dbuser")
  62.         dbpwd = GetSetting(App.CompanyName, App.EXEName, "dbpwd")
  63.         koneksi.ConnectionString = "DRIVER={MySQL ODBC 5.3 ANSI Driver};" _
  64.                               & "SERVER=" & dbhost & ";" _
  65.                               & " DATABASE=" & dbname & ";" _
  66.                               & " PORT=3306;" _
  67.                               & "UID=" & dbuser & ";PWD=" & dbpwd & "; OPTION=3"
  68.         koneksi.Open
  69.         SaveSetting App.CompanyName, App.EXEName, "dbstatus", "Ready"
  70.        
  71.     Else
  72.        
  73.         Set koneksi = New ADODB.Connection
  74.         koneksi.Open GetSetting(App.CompanyName, App.EXEName, "nDSN")
  75.     End If
  76.     Exit Sub
  77. handle:
  78.     fKoneksi.Show vbModal
  79.     Exit Sub
  80. End Sub
  81.  
  82. Public Function dTanggal(ByVal data As String) As String
  83. Select Case data
  84.     Case "1"
  85.         bln = "Januari"
  86.     Case "2"
  87.         bln = "Februari"
  88.     Case "3"
  89.         bln = "Maret"
  90.     Case "4"
  91.         bln = "April"
  92.     Case "5"
  93.         bln = "Mei"
  94.     Case "6"
  95.         bln = "Juni"
  96.     Case "7"
  97.         bln = "Juli"
  98.     Case "8"
  99.         bln = "Agustus"
  100.     Case "9"
  101.         bln = "September"
  102.     Case "10"
  103.         bln = "Oktober"
  104.     Case "11"
  105.         bln = "November"
  106.     Case "12"
  107.         bln = "Desember"
  108. End Select
  109. dTanggal = Format(Now, "dd") & "-" & bln & "-" & Format(Now, "yyyy")
  110.      
  111. End Function
  112.  
  113. Public Function RKanan(ByVal kata As String) As String
  114. 'maksimum 14 digit
  115. Select Case Len(Trim(kata))
  116.     Case "1"
  117.          RKanan = Space(24) + kata
  118.     Case "2"
  119.          RKanan = Space(24) + kata
  120.     Case "3"
  121.          RKanan = Space(20) + kata
  122.     Case "4"
  123.          RKanan = Space(24) + kata
  124.     Case "5"
  125.          RKanan = Space(16) + kata
  126.     Case "6"
  127.          RKanan = Space(14) + kata
  128.     Case "7"
  129.          RKanan = Space(13) + kata
  130.     Case "8"
  131.          RKanan = Space(12) + kata
  132.     Case "9"
  133.          RKanan = Space(10) + kata
  134.     Case "10"
  135.          RKanan = Space(8) + kata
  136.     Case "11"
  137.          RKanan = Space(6) + kata
  138.     Case "12"
  139.          RKanan = Space(4) + kata
  140.     Case "13"
  141.         RKanan = Space(2) + kata
  142.     Case "14"
  143.         RKanan = kata
  144. End Select
  145. End Function
  146.  
  147. Public Function Lkanan(ByVal kata As String) As String
  148. 'maksimum 14 digit
  149. Select Case Len(Trim(kata))
  150.     Case "1"
  151.          Lkanan = Space(38) + kata
  152.     Case "2"
  153.          Lkanan = Space(36) + kata
  154.     Case "3"
  155.          Lkanan = Space(34) + kata
  156.     Case "4"
  157.          Lkanan = Space(32) + kata
  158.     Case "5"
  159.          Lkanan = Space(30) + kata
  160.     Case "6"
  161.          Lkanan = Space(28) + kata
  162.     Case "7"
  163.          Lkanan = Space(26) + kata
  164.     Case "8"
  165.          Lkanan = Space(24) + kata
  166.     Case "9"
  167.          Lkanan = Space(22) + kata
  168.     Case "10"
  169.          Lkanan = Space(21) + kata
  170.     Case "11"
  171.          Lkanan = Space(18) + kata
  172.     Case "12"
  173.          Lkanan = Space(18) + kata
  174.     Case "13"
  175.          Lkanan = Space(14) + kata
  176.     Case "14"
  177.         Lkanan = Space(12) + kata
  178.     Case "15"
  179.         Lkanan = Space(10) + kata
  180.     Case "16"
  181.         Lkanan = Space(10) + kata
  182.     Case "17"
  183.         Lkanan = Space(6) + kata
  184.     Case "18"
  185.         Lkanan = Space(4) + kata
  186.     Case "19"
  187.         Lkanan = Space(2) + kata
  188.     Case "20"
  189.         Lkanan = kata
  190.     End Select
  191.    
  192. End Function
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top