Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- Dim rs_opex As Worksheet
- Set rs_opex = ThisWorkbook.Sheets("OPEX")
- If TextBox_username.Value = "" Or TextBox_password.Value = "" Then
- MsgBox "Enter Username and Password"
- End If
- 'Declare Variables
- Dim objMyconn As Object
- Dim objMyCmd As Object
- Dim objMyRecordset As Object
- Set objMyconn = CreateObject("ADODB.Connection")
- Set objMyCmd = CreateObject("ADODB.Command")
- Set objMyRecordset = CreateObject("ADODB.Recordset")
- objMyconn.ConnectionString = "DRIVER={PostgreSQL Unicode};" & _
- "SERVER=something;" & _
- "DATABASE=whatever;" & _
- "USER=sawantdr;" & _
- "PORT=1234;" & _
- "PASSWORD=abc1234;" & _
- "Option=0"
- objMyconn.Open
- If CheckBox_opex.Value = True Then
- MsgBox "Clicked OPEX"
- End If
- End Sub
Add Comment
Please, Sign In to add comment