Hi Klaus, many thanks for you time, again
Is when I open the card, I have a PreOpenCard (I tried to put in a OpenCard with the same result) that calls to the script getDatabase:
Code: Select all
on getDatabase
put URL ("file:" & imagePathGet() & "/tabla.txt") into tableId
put URL ("file:" & imagePathGet() & "/user.txt") into vActualUser
connectToDB
put "SELECT * FROM " & tableId & " where id=0" into tQuery
put revDataFromQuery(comma,return,gConnID,tQuery) into tRecords
put 1 into vUser[1][2]
put 2 into vUser[2][2]
put 3 into vUser[3][2]
put 4 into vUser[4][2]
put 5 into vUser[5][2]
put 6 into vUser[6][2]
put 7 into vUser[7][2]
put 8 into vUser[8][2]
put 9 into vUser[9][2]
put 10 into vUser[10][2]
put item 8 of tRecords into vUser[1][1]
put item 9 of tRecords into vUser[1][0]
put item 10 of tRecords into vUser[2][1]
put item 11 of tRecords into vUser[2][0]
put item 12 of tRecords into vUser[3][1]
put item 13 of tRecords into vUser[3][0]
put item 14 of tRecords into vUser[4][1]
put item 15 of tRecords into vUser[4][0]
put item 16 of tRecords into vUser[5][1]
put item 17 of tRecords into vUser[5][0]
put item 18 of tRecords into vUser[6][1]
put item 19 of tRecords into vUser[6][0]
put item 20 of tRecords into vUser[7][1]
put item 21 of tRecords into vUser[7][0]
put item 22 of tRecords into vUser[8][1]
put item 23 of tRecords into vUser[8][0]
put item 24 of tRecords into vUser[9][1]
put item 25 of tRecords into vUser[9][0]
put item 26 of tRecords into vUser[10][1]
put item 27 of tRecords into vUser[10][0]
put 0 into vMany
repeat with cVariable= 1 to 10
if vUser[cVariable][1] > 0 then
add 1 to vMany
end if
end repeat
# this part's not required, but a good idea to check for errors
if tRecords begins with "revdberr" then
answer error "There was a problem accessing the database: of Users"
closeDB gConnID
exit to top
end if
# end error check
--end if
end getDatabase
and this in the stack:
Code: Select all
on connectToDB
put revOpenDatabase ("mysql","www.xxx.com”,”xx”,”xx”,”xx") into tConxn
# it's a good idea, but not required, to check for a successful connection here
if tConxn is a number then
put tConxn into gConnID
--revExecuteSQL gConnID, "SET NAMES 'utf8'"
return empty
else
put "Unable to connect to database" into tErrMsg
answer error tErrMsg as sheet
put empty into gConnID
return tErrMsg
exit to top
end if
end connectToDB
on closeDB pConnID
revCloseDatabase pConnID
# this ensures that you'll never have a left-over connection number in the global var
if pConnID = gConnID then
put empty into gConnID
end if
end closeDB
And the internet connection goes on ADSL with no problem.
