Guest User

Untitled

a guest
Sep 27th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Private Sub CommandButton1_Click()
  2.  
  3. Dim rs_opex As Worksheet
  4. Set rs_opex = ThisWorkbook.Sheets("OPEX")
  5.  
  6. If TextBox_username.Value = "" Or TextBox_password.Value = "" Then
  7. MsgBox "Enter Username and Password"
  8. End If
  9.  
  10. 'Declare Variables
  11. Dim objMyconn As Object
  12. Dim objMyCmd As Object
  13. Dim objMyRecordset As Object
  14.  
  15. Set objMyconn = CreateObject("ADODB.Connection")
  16. Set objMyCmd = CreateObject("ADODB.Command")
  17. Set objMyRecordset = CreateObject("ADODB.Recordset")
  18.  
  19. objMyconn.ConnectionString = "DRIVER={PostgreSQL Unicode};" & _
  20. "SERVER=something;" & _
  21. "DATABASE=whatever;" & _
  22. "USER=sawantdr;" & _
  23. "PORT=1234;" & _
  24. "PASSWORD=abc1234;" & _
  25. "Option=0"
  26.  
  27. objMyconn.Open
  28.  
  29.  
  30. If CheckBox_opex.Value = True Then
  31. MsgBox "Clicked OPEX"
  32. End If
  33.  
  34.  
  35. End Sub
Add Comment
Please, Sign In to add comment