Android Question Problem with JdbcResultSet

roberf8

New Member
Licensed User
Longtime User
I have a problem with this code:

Dim sql1 As JdbcSQL
Dim ObjetoSql As Object
Dim recipes As List
Dim sql As String

Try
sql1.Close
sql1.InitializeAsync("Connect", "net.sourceforge.jtds.jdbc.Driver", "jdbc:jtds:sqlserver://Servidor;databaseName=BD;", "Usuario", "Pwd")
Catch
Msgbox2Async("Error " & LastException.Message , "Error", "OK","","", Null, True)

End Try

sql = "select empresas.nomco from avisosat" & _
" inner join empresas on avisosat.empresa = empresas.empresa And avisosat.cliente = empresas.codigo And empresas.tipo = 'C' where terminado = '0'"

ObjetoSql = sql1.ExecQueryAsync("SQL", sql, Null)
Wait For (ObjetoSql) SQL_QueryComplete (Success As Boolean, Cursor As JdbcResultSet)

If Success Then
recipes.Initialize
Do While Cursor.NextRow
Dim m As Map
m.Initialize()
m.Put("nombre", Cursor.GetString("nomco").Trim)
recipes.Add(m)
Loop
Cursor.close
End If



The problem is when the result of SQL have more than 23 rows. When I'm in debug mode, works fine, but in release mode the app closes without any message. If I make the following query, works fine in debug and release mode:


sql = "select top 23 empresas.nomco from avisosat" & _
" inner join empresas on avisosat.empresa = empresas.empresa And avisosat.cliente = empresas.codigo And empresas.tipo = 'C'" & _
" where terminado = '0'"


Any help please?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…