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
Longtime User
What i'm doing wrong ???
Creating two identical threads for the same issue is probably one of.

Are you connected to the same network (over wifi)?
Is the firewall/router configured to let you access this host?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

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
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime 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:
Upvote 0

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
 
Upvote 0

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
 
Upvote 0
Status
Not open for further replies.
Top