Hi guys,
I have the following codes
SqlLt variable declare in Sub Process Global of main Activity.
Those code raised an error said that Column prc and id are unknown.
If Sqlt variable declare in the same activity, no error raised.
Changing the code to this codes, fix the problem (change prc->PRC and id->ID)
Changing Cur.GetString("art") to Cur.GetString("ART") also raised an error.
The only reliable method is using GetInt2(column index) or GetString2(column index).
Am I missed something here?
I have the following codes
B4X:
Sub GetArtNm
If(ArtCdTxt.Text = "") Then Return
Dim Cur As Cursor
Cur = Main.SqlLt.ExecQuery("select a.id, a.art || ' ' || a.clr || ' ' || a.sz as art, a.prc from m_art a where a.unt = 'PSG' and a.id = " & ArtCdTxt.Text)
If(Cur.RowCount = 0) Then
MsgBox("Art not found!","")
ArtCdTxt.RequestFocus
ArtCdTxt.SelectAll
ArtLbl.Text = ""
Cur.Close
Return
End If
For i = 0 To Cur.RowCount - 1
Cur.Position = i
ArtLbl.Text = Cur.GetString("art")
HrgTxt.Text = NumberFormat2(Cur.GetInt("prc"),0,0,0,True)
ArtId = Cur.GetInt("id")
Next
Cur.Close
If(QtyTxt.Text = "") Then QtyTxt.Text = 1
End Sub
SqlLt variable declare in Sub Process Global of main Activity.
Those code raised an error said that Column prc and id are unknown.
If Sqlt variable declare in the same activity, no error raised.
Changing the code to this codes, fix the problem (change prc->PRC and id->ID)
B4X:
HrgTxt.Text = NumberFormat2(Cur.GetInt("PRC"),0,0,0,True)
ArtId = Cur.GetInt("ID")
Changing Cur.GetString("art") to Cur.GetString("ART") also raised an error.
The only reliable method is using GetInt2(column index) or GetString2(column index).
Am I missed something here?