#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
#AdditionalJar: jtds-1.3.1
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Dim SQL1 As SQL
Dim res As ResultSet
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Dim connected As Boolean = False
SQL1.Initialize("net.sourceforge.jtds.jdbc.Driver","jdbc:jtds:sqlserver://xx.x.xxx.xx:1433/Syspro_Live_XXX_X;integratedSecurity=true;useNTLMv2=true;")
connected = SQL1.IsInitialized
Log("connected = " & connected)
res = SQL1.ExecQuery("SELECT Customer FROM ArTrnDetail Where ArTrnDetail.TrnYear = '2022' and ArTrnDetail.TrnMonth = '06';")
Do While res.NextRow
Dim datarow(2) As Object
datarow(0) = res.GetString("Customer")
Log(datarow(0))
Loop
End Sub