error connecting to remote mssql

cirollo

Active Member
Licensed User
Longtime User
Hello!

I'm encountering an error when trying to connect to remote MSSQL 2005 DB
I've downloaded last agraham library (1.9)

this is my code:

B4X:
Sub App_Start
   Menu.Show
   'apro la connessione con il db remoto
   Sql1.New1
   If SQL1.Open("Persist Security Info=False;Integrated Security=False;Server=192.168.1.90,1433;initial catalog=Ahr60; user id=sa;password=fiesta;") Then
        Msgbox("Conessione al DB Stabilita con Successo!!!","My First Program",cMsgboxYesNo,cMsgboxHand)
      
    Else    
        Msgbox("Impossibile Connettersi al DB!!!","My First Program",cMsgboxYesNo,cMsgboxHand)
      Msgbox(sql1.LastError,"")
    End If
End Sub

in attached the error I get!
 

Attachments

  • errore_conn.jpg
    errore_conn.jpg
    50.2 KB · Views: 275

cirollo

Active Member
Licensed User
Longtime User
I'm using the simulator

the credentials are ok

I can connect using other programming languages

Maybe is better to connect from a real device?

How can I install on the device???
 

cirollo

Active Member
Licensed User
Longtime User
I cannot connect!!!

Erel, I'm sure of the credentials but I cannot connect to a remote (via wlan) sql express 2005 with sql login mode (sa)

this is my code, any suggestions??? antivirus, firewall also disactivated!

B4X:
Sub App_Start
   Menu.Show
   Dim SVR,USR,PWD,DBN As String
   'leggo dal file di testo i parametri per comporre la stringa di connessione al db remoto
   If FileExist ("DBConnParam.txt") = True Then
      Msgbox("File Parametri Connessione Trovato!",progname,cMsgboxYesNo,cMsgboxHand)
        FileOpen (c1,"DBConnParam.txt",cRead ,, cASCII)
        r = FileRead (c1)
       Do Until r = EOF
           Select SubString (r,0,3)
         Case "SVR"
               SVR = SubString (r,3,StrLength (r)-3)
            Msgbox (SVR)
             Case "USR"
                 USR = SubString (r,3,StrLength (r)-3)
            Msgbox (USR)
         Case "PWD"
                PWD = SubString (""&r,3,StrLength (r)-3)
            Msgbox (PWD)
         Case "DBN"
                DBN = SubString (""&r,3,StrLength (r)-3)
            Msgbox (DBN)
         End Select
         r = FileRead (c1)
      Loop
      FileClose (c1)
      'apro la connessione con il db remoto
      Sql1.New1
      If SQL1.Open("Persist Security Info=False;Integrated Security=False;Server="&SVR &",1433;initial catalog=" &DBN &";user id="&USR &";password="&PWD&";") Then
           Msgbox("Conessione al DB Stabilita con Successo!!!","My First Program",cMsgboxYesNo,cMsgboxHand)
       Else    
           Msgbox("Impossibile Connettersi al DB!!!",progname,cMsgboxYesNo,cMsgboxHand)
         Msgbox(sql1.LastError,"")
       End If
   Else
      Msgbox("File Parametri Connessione Non Trovato!",progname,cMsgboxYesNo,cMsgboxHand)
   End If

End Sub
 
Top