Code: Select all
on connectToDB
    
    put "xxx.xxx.xxx.xxx:3306" into gDatabaseAddress
    put "xxxxxxxx" into gDatabaseName
    put "xxxxxxxx" into gDatabaseUser
    put "xxxxxxxx" into gDatabasePassword
    
    --put URLEncode(gDatabasePassword) into tDatabasePassword
    
    put revOpenDatabase("MySQL", gDatabaseAddress, gDatabaseName, gDatabaseUser, gDatabasePassword) into tConxn
    
    --answer 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 gConnectionID
       --put "Connection ID: " & gConnectionID & cr before fld "fldMessage"
       answer "DB Connection Success!"
        return empty
    else
        put "Unable to connect to database '" & gDatabaseName & "': " & tConxn into tErrMsg
        --answer error tErrMsg as sheet
        answer tErrMsg
        --put tErrMsg & cr before fld "fldMessage"
        put empty into gConnectionID
        return tErrMsg
        exit to top
     end if
     
end connectToDBWhen I deploy the app for testing on an actual device, I am using an iPhone 5S and an iPhone 6. No error messages appear on the device, but it is clear that the code simply stops executing when I run the connectToDB function.

