|
| 1 | +VERSION 5.00 |
| 2 | +Begin VB.Form Form1 |
| 3 | + Caption = "AppDynamics VB6 Wrapper Simple Test" |
| 4 | + ClientHeight = 3210 |
| 5 | + ClientLeft = 120 |
| 6 | + ClientTop = 465 |
| 7 | + ClientWidth = 4935 |
| 8 | + LinkTopic = "Form1" |
| 9 | + ScaleHeight = 3210 |
| 10 | + ScaleWidth = 4935 |
| 11 | + StartUpPosition = 3 'Windows Default |
| 12 | + Begin VB.TextBox Text1 |
| 13 | + Height = 285 |
| 14 | + Left = 1800 |
| 15 | + TabIndex = 2 |
| 16 | + Text = "1500" |
| 17 | + Top = 240 |
| 18 | + Width = 1335 |
| 19 | + End |
| 20 | + Begin VB.CommandButton Command2 |
| 21 | + Caption = "BT 2 - Cash Withdraw" |
| 22 | + Height = 855 |
| 23 | + Left = 960 |
| 24 | + TabIndex = 1 |
| 25 | + Top = 2040 |
| 26 | + Width = 2775 |
| 27 | + End |
| 28 | + Begin VB.CommandButton Command1 |
| 29 | + Caption = "BT1 - Login" |
| 30 | + Height = 855 |
| 31 | + Left = 960 |
| 32 | + TabIndex = 0 |
| 33 | + Top = 840 |
| 34 | + Width = 2775 |
| 35 | + End |
| 36 | +End |
| 37 | +Attribute VB_Name = "Form1" |
| 38 | +Attribute VB_GlobalNameSpace = False |
| 39 | +Attribute VB_Creatable = False |
| 40 | +Attribute VB_PredeclaredId = True |
| 41 | +Attribute VB_Exposed = False |
| 42 | + |
| 43 | + |
| 44 | +Dim rv As Variant |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +Private Sub Command1_Click() |
| 49 | + |
| 50 | +Dim tokenBT, tokenExitCall As String |
| 51 | +tokenBT = GetGUID |
| 52 | +tokenExitCall = GetGUID |
| 53 | +Dim valor As String |
| 54 | +valor = Text1.Text |
| 55 | + |
| 56 | +'Start the Business Transaction Execution for Cash WithDraw Transaction |
| 57 | +rv = AppD_StartBT("Login", "NullCorrelation", tokenBT) |
| 58 | + |
| 59 | +'--- |
| 60 | +'Your code would be here |
| 61 | +'--- |
| 62 | + |
| 63 | +'Declare the Database Backend |
| 64 | +rv = AppD_BackEndDeclare("DB", "SQLPRD06") |
| 65 | +rv = AppD_SetIdentifyingProperty("SQLPRD06", "HOST", "SQLPRD06.company.com") |
| 66 | +rv = AppD_SetIdentifyingProperty("SQLPRD06", "PORT", "1433") |
| 67 | +rv = AppD_SetIdentifyingProperty("SQLPRD06", "DATABASE", "DBUsuarios") |
| 68 | +rv = AppD_SetIdentifyingProperty("SQLPRD06", "VENDOR", "Microsoft") |
| 69 | +rv = AppD_BackendAdd("SQLPRD06") |
| 70 | + |
| 71 | +'Start the Exit Call (DB) Execution |
| 72 | +rv = AppD_ExitCallBegin(tokenBT, tokenExitCall, "SQLPRD06") |
| 73 | +rv = AppD_ExitCallSetDetails(tokenExitCall, "SELECT USERNAME FROM AUTHENTICATION WHERE USERNAME=JOHN") |
| 74 | + |
| 75 | +Sleep Val(valor) 'Sleep to simulate a query execution/slowness |
| 76 | + |
| 77 | + |
| 78 | +'Terminate the Exit Call Execution |
| 79 | +rv = AppD_ExitCallEnd(tokenExitCall) |
| 80 | + |
| 81 | +'--- |
| 82 | +' Your code would terminate here |
| 83 | +'--- |
| 84 | + |
| 85 | +' Terminate the Business Transaction Execution |
| 86 | +rv = AppD_EndBT(tokenBT) |
| 87 | + |
| 88 | + |
| 89 | +End Sub |
| 90 | + |
| 91 | +Private Sub Command2_Click() |
| 92 | +Dim number As Integer |
| 93 | +For number = 1 To 10 |
| 94 | +Dim tokenBT, tokenExitCall As String |
| 95 | +tokenBT = GetGUID |
| 96 | +tokenExitCall = GetGUID |
| 97 | +Dim valor As String |
| 98 | +valor = Text1.Text |
| 99 | + |
| 100 | +'Start the Business Transaction Execution for Cash WithDraw Transaction |
| 101 | +rv = AppD_StartBT("Cash Withdraw", "NullCorrelation", tokenBT) |
| 102 | + |
| 103 | +'--- |
| 104 | +'Your code would be here |
| 105 | +'--- |
| 106 | + |
| 107 | +'Declare the Database Backend |
| 108 | +rv = AppD_BackEndDeclare("DB", "SQLPRD05") |
| 109 | +rv = AppD_SetIdentifyingProperty("SQLPRD05", "HOST", "SQLPRD05.company.com") |
| 110 | +rv = AppD_SetIdentifyingProperty("SQLPRD05", "PORT", "1433") |
| 111 | +rv = AppD_SetIdentifyingProperty("SQLPRD05", "DATABASE", "DBUsuarios") |
| 112 | +rv = AppD_BackendAdd("SQLPRD05") |
| 113 | + |
| 114 | +'Start the Exit Call (DB) Execution |
| 115 | +rv = AppD_ExitCallBegin(tokenBT, tokenExitCall, "SQLPRD05") |
| 116 | +rv = AppD_ExitCallSetDetails(tokenExitCall, "SELECT * FROM USERS WHERE USERNAME=JOHN") |
| 117 | + |
| 118 | +Sleep Val(valor) 'Sleep to simulate a query execution/slowness |
| 119 | + |
| 120 | +'Terminate the Exit Call Execution |
| 121 | +rv = AppD_ExitCallEnd(tokenExitCall) |
| 122 | + |
| 123 | + |
| 124 | +'--- |
| 125 | +' Your code would terminate here |
| 126 | +'--- |
| 127 | + |
| 128 | +' Terminate the Business Transaction Execution |
| 129 | +rv = AppD_EndBT(tokenBT) |
| 130 | + |
| 131 | +Next |
| 132 | + |
| 133 | +End Sub |
| 134 | + |
| 135 | +Private Sub Form_Load() |
| 136 | + |
| 137 | +rv = AppD_Initialize("controllerhost.appdynamics.com", 8090, 0, "account_name", "account_key", "Application_Name", "Tier_Name", "Node_Name", "c:\\appdlib\\") |
| 138 | + |
| 139 | +End Sub |
0 commit comments