SHARE
TWEET

VBA MS Access ACE.OLEDB.12.0 : Input Data Dari TextBox Form

stevennathaniel Mar 15th, 2016 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Command11_Click()
  2.  
  3.  
  4. Dim uid As String
  5.  
  6. Dim namaawal As String
  7.  
  8. Dim namaakhir As String
  9.  
  10. Dim usia As String
  11.  
  12.  
  13. uid = Text14
  14.  
  15. namaawal = Text4
  16.  
  17. namaakhir = Text2
  18.  
  19. usia = Text9
  20.  
  21.  
  22. Dim connector As ADODB.Connection
  23.  
  24. Set connector = Nothing
  25.  
  26. Dim strStatement As String
  27.  
  28. strStatement = "INSERT INTO dataUsia(idusia,namaawal,namaakhir,usia)values" & "('" & uid & "','" & namaawal & "','" & namaakhir & "','" & usia & "')"
  29.  
  30. Set connector = New ADODB.Connection
  31.  
  32. connector.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\fileAccess\Database3.mdb;Persist Security Info=False"
  33.  
  34. connector.Execute strStatement
  35.  
  36. connector.Close
  37.  
  38. Set connector = Nothing
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. End Sub
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