ms-sql server connection from android device
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 7
- Joined: Sun Feb 08, 2015 8:42 pm
ms-sql server connection from android device
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?
Last edited by pati tamas on Fri Mar 20, 2015 5:26 pm, edited 1 time in total.
Re: ms-sql server connection from android device
Hi pati,
please check your syntax against the example syntax in the dictionary, does not look too similar at all!
Best
Klaus
please check your syntax against the example syntax in the dictionary, does not look too similar at all!

Best
Klaus
-
- Posts: 7
- Joined: Sun Feb 08, 2015 8:42 pm
Re: ms-sql server connection from android device
Thanks for your replay,Klaus
It does work in my windows app, excatly the same code
Somebody please?
It does work in my windows app, excatly the same code
Somebody please?
Re: ms-sql server connection from android device
Hi pati,
ah, ok, just a thought, I'm not an odbc expert
Best
Klaus
ah, ok, just a thought, I'm not an odbc expert

Best
Klaus
Re: ms-sql server connection from android device
Hi Pati,
ODBC is not supported on Android/iOS. Direct DB support is currently limited to MySQL and SQLite on mobile. However, you may be able to write a web service which will allow you to pull and push data to this type of DB
The following forum post has more information on this-
http://forums.livecode.com/phpBB2/viewt ... SQL+SERVER
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
ODBC is not supported on Android/iOS. Direct DB support is currently limited to MySQL and SQLite on mobile. However, you may be able to write a web service which will allow you to pull and push data to this type of DB
The following forum post has more information on this-
http://forums.livecode.com/phpBB2/viewt ... SQL+SERVER
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
Re: ms-sql server connection from android device
Aha!
OK, that should definitively be noted in the dictionary under "revopendatabase"!

OK, that should definitively be noted in the dictionary under "revopendatabase"!
-
- Posts: 7
- Joined: Sun Feb 08, 2015 8:42 pm
Re: ms-sql server connection from android device
Thank's for all of you, i'm a kind of disapponted...
I'll look for the another way you suggested, Roger.
I'll look for the another way you suggested, Roger.