The below code creates an exception when I query the length of f.actype and this string is empty.
I.e. cursor1.GetString2(13) had returned an empty SQL string in the row before.
But why is an exception thrown?
It seems to me that an empty string from SQL is different than an empty B4A string?
Thanks
Andy
Type TFlight (actype As String)
Sub get_adata_fromsql (icao As String) As TFlight
If sql1.IsInitialized=True Then
Dim f As TFlight
f.Initialize
cursor1=sql1.ExecQuery("SELECT * from aircraft WHERE abc="& Chr(34)& icao & Chr(34))
If cursor1.RowCount>0 Then
Try
cursor1.Position=0
f.actype=cursor1.GetString2(13)
If f.actype.Length=0 Then
Log("***")
End If
Catch
Log("Exception on SQL: "&icao)
End Try
End If
End If
Return f
End Sub