Android Question problem with JdbcSQL

kreativa sas

Member
Licensed User
Hi,
i have a problem with JdbcSQL, i try to explain:
I'm using JdbcSQL to read a mssql database and wverything works fine.
I do a select query in async mode using ExecQueryAsync and it's ok but if I use a query with a left join the app crashes.
The app crashes only in release mode and only the second loop of the nextrow cicle (the first loop is ok but when the app starts to read the second record crashes in release mode (on debug i have no errors)

Somebody can help me?
thanks!!

here is my code:
B4X:
    Wait For (Connect_) Complete (Success As Boolean)
    If Success Then
    Dim str="select * from k_cicliprod as cp left join k_produzione as p on cp.rowid = p.rowid where p.kid=? and cod_cdl=?"
'    Dim sf As JdbcResultSet = mysql.ExecQuery2(str,Array As Int(cruscotto.idfase,cruscotto.cod_cdl ))
    Dim sf As Object = mysql.ExecQueryAsync("mysql",str, Array As Int(cruscotto.idfase,cruscotto.cod_cdl ) )
    Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
    
    If Success Then
    Dim mypass As String
    Do While Crsr.nextrow
        Dim pp As StringFunctions2
        Label2.text=cruscotto.operatore
        Label4.Text=Crsr.GetString("descr_cdl")
        Label6.Text=Crsr.GetString("numpreventivo")
        Label31.Text=Crsr.GetString("descrizionecliente")
        Label33.Text=Crsr.GetString("prodotto")
        Label35.Text=Crsr.GetString("qta")
        Label11.Text=Crsr.GetString("formato_carta")
        Label12.Text=Crsr.GetString("grammi_carta")
        Label14.Text=Crsr.GetString("tipo_carta")
        Label24.Text=Crsr.GetString("resa_stampa")
        Label18.Text=Crsr.GetString("fto_fustella")
        Label17.Text=Crsr.GetString("descr_fustella")
        Label16.text=Crsr.GetString("resa_fustella")
        Label29.Text=Crsr.GetString("fto_cartone")
        Label28.Text=Crsr.GetString("tipo_cartone")
        datap=Crsr.GetString("datainizioreale")
        dataf=Crsr.GetString("datafinereale")
        idfaseprod=Crsr.GetString("id")
        If datap=Null Then
            Button1.Text="Inizia la lavorazione"
            Label36.Visible=False
            wip=False
        Else
            Button1.Text="chiudi la lavorazione"
            Label36.Visible =True
            wip=True   
        End If
        If dataf=Null Then
            
        Else
            Label36.Visible=False
            Button1.Enabled=False
            Label37.Visible =True
    
            wip=True
        End If
        
        
    Loop
 

josejad

Expert
Licensed User
Longtime User
Try this

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…