Android Question MSSQL Query to MSSQL DB

Status
Not open for further replies.

DataProtec

Member
Licensed User
Hello
After days Reading ALL Threads of the Forum and checking the Internet finaly i can connect to a MSSQL DB :)
But it is imposible to make a query and get a Result back
I asked in another Thread but it did not realy help to my problem, so i try again and hopefully get a helpful respond
I need only the respond from the server, the query is a real query i have to use.
What i'm doing wrong ???

B4X:
'****here the full code again
#AdditionalJar: jtds-1.3.1.jar

Sub Process_Globals
    Public msSQL As JdbcSQL
    Private driver As String = "net.sourceforge.jtds.jdbc.Driver"
    Private jdbcUrl As String = "jdbc:jtds:sqlserver://192.168.5.21:1433/DB_Datos"
    Private Username As String = "sa"
    Private Password As String = "1234"
End Sub

    '*** Works without any Error, but no Result ***
Sub cmdConnect_Click
    msSQL.Close
    msSQL.InitializeAsync("msSQL", driver, jdbcUrl, Username, Password)
    
        Dim sf As Object = msSQL.ExecQueryAsync("msSQL", "SELECT UserID, Name FROM UserInfo_Table WHERE UserID = '5'", Null)
        Wait For (sf) msSQL_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
        
    If Success Then
        Do While Crsr.NextRow
            Log($"Name: ${Crsr.GetInt("Name")}"$)
        Loop
        Crsr.Close
    End If
End sub
 

DonManfred

Expert
Licensed User

DataProtec

Member
Licensed User
First DonManfred, Thanks a lot, now can receive the expected Information.

Hallo Erel
The System B4A and B4i i like, easy to install and good to handle.
But some things are realy hard, one of them is the DB work, there are a lot of info in the Forum but all are Fragments which are dificult to understand.
So after a lot of unnesseary discussions before DonManfred gave the expected Info and done, it Works :)
Why not from the begining, save a lot of your and my time.
I do the same as you, working a Supporter for VB Net and C#, i now how difficult it is.
regards
Uli - DataProTec
 

Erel

Administrator
Staff member
Licensed User

DonManfred

Expert
Licensed User
I do the same as you, working a Supporter
Beside Erel noone here is working for Anywhere Software.

If i try to help i do it in my free time. To bad if i do not get a LIKE from the one searching for help :-(
 
Last edited:

DataProtec

Member
Licensed User
Sorry, that was not my intention, of course you will get more then 1 LIKE for what you did for me, i now how dificult it is to give some proper Help.
It happens to as well to in other forums
regards
Uli
 

DataProtec

Member
Licensed User
Hi
I have added a Textfiled to the Designer in B4A
I have allready to Texfields and no problema
But the new texfield gives me the error "java.lang.RuntimeException: Field: _txtfulltext not found in: b4a.example.main"
It is configured as the other 2
Why get the message
thanks
Uli DataProtec
 
Status
Not open for further replies.
Top