ms-sql server connection from android device
Posted: Fri Mar 20, 2015 4:50 pm
Hi everyone!
/ First to Klaus: havent been to my computer for a while, but thank's for your reply earlier! /
I have developed an app for android, which should connect to an ms-sql server express 2008 on my windows 7 machine. My other app deployed for windows does the same. Actually same code should work for both platform ...
--------------------------------------------------------------------------------------------------------------------------------------------------------------
on mouseup
global ahConnID
put "xy,1433" into aPrefs["DBServer"]
put "xy" into aPrefs["DBDatabase"]
put "xy" into aPrefs["DBUser"]
put "xy" into aPrefs["DBPassword"]
put revOpenDatabase("ODBC","DRIVER=SQL Server;SERVER=" & aPrefs["DBServer"] \
& ";DATABASE=" & aPrefs["DBDatabase"] & ";UID=" & aPrefs["DBUser"] \
& ";PWD=" & aPrefs["DBPassword"] \
& ";Trusted_Connection=No",,,) into tResult
if tResult is a number then
put tResult into ahConnID
answer info "Connected to the database." & cr & "Conn ID = " & ahConnID
else
put empty into ahConnID
answer error "Unable to connect to the database:" & cr & tResult
end if
end mouseUp
--------------------------------------------------------------------------------------------------------------------------------------------
Is there any platform specific thingies for android?
The same code works in my windows app without problem...
On my android device everything works except this button, which supposed to connect to the database, giving "revdberr,invalid database" message! Why?
/ First to Klaus: havent been to my computer for a while, but thank's for your reply earlier! /
I have developed an app for android, which should connect to an ms-sql server express 2008 on my windows 7 machine. My other app deployed for windows does the same. Actually same code should work for both platform ...
--------------------------------------------------------------------------------------------------------------------------------------------------------------
on mouseup
global ahConnID
put "xy,1433" into aPrefs["DBServer"]
put "xy" into aPrefs["DBDatabase"]
put "xy" into aPrefs["DBUser"]
put "xy" into aPrefs["DBPassword"]
put revOpenDatabase("ODBC","DRIVER=SQL Server;SERVER=" & aPrefs["DBServer"] \
& ";DATABASE=" & aPrefs["DBDatabase"] & ";UID=" & aPrefs["DBUser"] \
& ";PWD=" & aPrefs["DBPassword"] \
& ";Trusted_Connection=No",,,) into tResult
if tResult is a number then
put tResult into ahConnID
answer info "Connected to the database." & cr & "Conn ID = " & ahConnID
else
put empty into ahConnID
answer error "Unable to connect to the database:" & cr & tResult
end if
end mouseUp
--------------------------------------------------------------------------------------------------------------------------------------------
Is there any platform specific thingies for android?
The same code works in my windows app without problem...
On my android device everything works except this button, which supposed to connect to the database, giving "revdberr,invalid database" message! Why?