From 1cea2483745331acac27f8a3262d92d6a12ae3f8 Mon Sep 17 00:00:00 2001 From: Luis Redda Date: Mon, 13 May 2019 11:52:04 -0300 Subject: [PATCH] Add new BT with error --- samples/VB6Sample/Form1.frm | 76 +++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/samples/VB6Sample/Form1.frm b/samples/VB6Sample/Form1.frm index fa894c6..2e76354 100755 --- a/samples/VB6Sample/Form1.frm +++ b/samples/VB6Sample/Form1.frm @@ -1,15 +1,23 @@ VERSION 5.00 -Begin VB.Form Form1 +Begin VB.Form Form1 Caption = "AppDynamics VB6 Wrapper Simple Test" - ClientHeight = 3210 + ClientHeight = 4485 ClientLeft = 120 ClientTop = 465 - ClientWidth = 4935 + ClientWidth = 7305 LinkTopic = "Form1" - ScaleHeight = 3210 - ScaleWidth = 4935 + ScaleHeight = 4485 + ScaleWidth = 7305 StartUpPosition = 3 'Windows Default - Begin VB.TextBox Text1 + Begin VB.CommandButton Command3 + Caption = "BT3 - Finish Order (With Error)" + Height = 855 + Left = 4080 + TabIndex = 3 + Top = 1800 + Width = 2535 + End + Begin VB.TextBox Text1 Height = 285 Left = 1800 TabIndex = 2 @@ -17,20 +25,20 @@ Begin VB.Form Form1 Top = 240 Width = 1335 End - Begin VB.CommandButton Command2 + Begin VB.CommandButton Command2 Caption = "BT 2 - Cash Withdraw" Height = 855 - Left = 960 + Left = 600 TabIndex = 1 - Top = 2040 + Top = 3000 Width = 2775 End - Begin VB.CommandButton Command1 + Begin VB.CommandButton Command1 Caption = "BT1 - Login" Height = 855 - Left = 960 + Left = 600 TabIndex = 0 - Top = 840 + Top = 1800 Width = 2775 End End @@ -132,6 +140,50 @@ Next End Sub +Private Sub Command3_Click() +Dim tokenBT, tokenExitCall As String +tokenBT = GetGUID +tokenExitCall = GetGUID +Dim valor As String +valor = Text1.Text + +'Start the Business Transaction Execution for Cash WithDraw Transaction +rv = AppD_StartBT("Finish Order", "NullCorrelation", tokenBT) + +'--- +'Your code would be here +'--- + +'Declare the Database Backend +rv = AppD_BackEndDeclare("DB", "SQLPRD06") +rv = AppD_SetIdentifyingProperty("SQLPRD06", "HOST", "SQLPRD06.company.com") +rv = AppD_SetIdentifyingProperty("SQLPRD06", "PORT", "1433") +rv = AppD_SetIdentifyingProperty("SQLPRD06", "DATABASE", "DBUsuarios") +rv = AppD_SetIdentifyingProperty("SQLPRD06", "VENDOR", "Microsoft") +rv = AppD_BackendAdd("SQLPRD06") + +'Start the Exit Call (DB) Execution +rv = AppD_ExitCallBegin(tokenBT, tokenExitCall, "SQLPRD06") +rv = AppD_ExitCallSetDetails(tokenExitCall, "SELECT USERNAME FROM AUTHENTICATION WHERE USERNAME=JOHN") + +'Set the error in the BT. You would to use a error handling function ideally +rv = AppD_AddBTError(tokenBT, 2, "Error to connecto to database: Null Connection String", 1) + +Sleep Val(valor) 'Sleep to simulate a query execution/slowness + + +'Terminate the Exit Call Execution +rv = AppD_ExitCallEnd(tokenExitCall) + +'--- +' Your code would terminate here +'--- + +' Terminate the Business Transaction Execution +rv = AppD_EndBT(tokenBT) +End Sub + + Private Sub Form_Load() rv = AppD_Initialize("controllerhost.appdynamics.com", 8090, 0, "account_name", "account_key", "Application_Name", "Tier_Name", "Node_Name", "c:\\appdlib\\")