Thanks for the 'quit'...

Yes, in mobile sometimes the things are different!!!

I think i made something wrong because changing this part of my code in this card, is not working the rest of my code ( for example when i am making one "SELECT" in another card before to show some data )
Now i will show you how is my code in the script once i changed what you told me:
local sDatabaseID
local tDatabasePath, tDatabaseID
global ruta
on preOpenStack
if the environment is "mobile" then
put "landscape left,landscape right" into theallowed
iphoneSetAllowedOrientations theallowed
end if
end preOpenStack
On OpenCard
put specialfolderpath("documents") & "/GestComp.sqlite" into ruta
## Path to db file in engine folder:
put specialfolderpath("engine") & "/GestComp.sqlite" into tEngineDB
## Check if we already copied the db file to users doc folder:
if there is NOT a file mypath then
put url("binfile:" & tEngineDB) into url("binfile:" & ruta)
end if
set enabled the button "btnConfig" to false
put CmpExist("VGestComp") into numb
if numb = 0 then
set enabled the button "btnConfig" to true
end if
end OpenCard
function CmpExist theData
databaseConnect
put getDatabaseID() into tDatabaseID
put revDataFromQuery(tab,return,tDatabaseID,"SELECT " & theData & " FROM VGest_Comp ") into theResult
return theResult
end CmpExist
command databaseConnect
put revOpenDatabase ("sqlite",ruta,,,,) into tDatabaseID
setDatabaseID tDatabaseID
end databaseConnect
command setDatabaseID pDatabaseID
put pDatabaseID into sDatabaseID
end setDatabaseID
function getDatabaseID
return sDatabaseID
end getDatabaseID
Is it ok? Or there is something wrong???
Regards