Page 1 of 1

ms-sql server connection from android device

Posted: Fri Mar 20, 2015 4:50 pm
by pati tamas
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?

Re: ms-sql server connection from android device

Posted: Fri Mar 20, 2015 4:57 pm
by Klaus
Hi pati,

please check your syntax against the example syntax in the dictionary, does not look too similar at all! 8)


Best

Klaus

Re: ms-sql server connection from android device

Posted: Fri Mar 20, 2015 5:10 pm
by pati tamas
Thanks for your replay,Klaus
It does work in my windows app, excatly the same code
Somebody please?

Re: ms-sql server connection from android device

Posted: Fri Mar 20, 2015 5:41 pm
by Klaus
Hi pati,

ah, ok, just a thought, I'm not an odbc expert 8)


Best

Klaus

Re: ms-sql server connection from android device

Posted: Fri Mar 20, 2015 5:47 pm
by LCNeil
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
--

Re: ms-sql server connection from android device

Posted: Fri Mar 20, 2015 6:18 pm
by Klaus
Aha! :D

OK, that should definitively be noted in the dictionary under "revopendatabase"!

Re: ms-sql server connection from android device

Posted: Fri Mar 20, 2015 7:07 pm
by pati tamas
Thank's for all of you, i'm a kind of disapponted...
I'll look for the another way you suggested, Roger.