ms-sql server connection from android device

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pati tamas
Posts: 7
Joined: Sun Feb 08, 2015 8:42 pm

ms-sql server connection from android device

Post by pati tamas » 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?
Last edited by pati tamas on Fri Mar 20, 2015 5:26 pm, edited 1 time in total.

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: ms-sql server connection from android device

Post by Klaus » Fri Mar 20, 2015 4:57 pm

Hi pati,

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


Best

Klaus

pati tamas
Posts: 7
Joined: Sun Feb 08, 2015 8:42 pm

Re: ms-sql server connection from android device

Post by pati tamas » Fri Mar 20, 2015 5:10 pm

Thanks for your replay,Klaus
It does work in my windows app, excatly the same code
Somebody please?

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: ms-sql server connection from android device

Post by Klaus » Fri Mar 20, 2015 5:41 pm

Hi pati,

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


Best

Klaus

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: ms-sql server connection from android device

Post by LCNeil » Fri Mar 20, 2015 5:47 pm

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

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: ms-sql server connection from android device

Post by Klaus » Fri Mar 20, 2015 6:18 pm

Aha! :D

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

pati tamas
Posts: 7
Joined: Sun Feb 08, 2015 8:42 pm

Re: ms-sql server connection from android device

Post by pati tamas » Fri Mar 20, 2015 7:07 pm

Thank's for all of you, i'm a kind of disapponted...
I'll look for the another way you suggested, Roger.

Post Reply