Skip to content

Commit

Permalink
Add new BT with error
Browse files Browse the repository at this point in the history
  • Loading branch information
luisredda authored May 13, 2019
1 parent 011e740 commit 1cea248
Showing 1 changed file with 64 additions and 12 deletions.
76 changes: 64 additions & 12 deletions samples/VB6Sample/Form1.frm
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
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
Text = "1500"
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
Expand Down Expand Up @@ -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\\")
Expand Down

0 comments on commit 1cea248

Please sign in to comment.