【发布时间】:2015-11-04 17:45:25
【问题描述】:
我在 livecode 中创建了一个使用 sqlite 数据库的应用程序。该应用程序使用以下代码连接到数据库:
on preopenstack
--Used to connect to the database when application
--first open and open the menu stack
set the itemDelimiter to " "
put item 2 of the name of the current stack into stackname
put the length of stackname into namelength
put char 2 to namelength-1 stackname into stackname
if stackname= "FoodPoisoningInvestigator" then
-- Open a connection to the database and store
--the database id into global variable so
--other handlers can access it
put the effective filename of this stack into tFolderPath
set the itemDelimiter to slash
delete last item of tFolderPath
put tFolderPath & "/mysql2.sqlite" into gDatabasePath
put revOpenDatabase("sqlite",gDatabasePath) into gDatabaseID
end if
end preopenstack
在独立设置对话框的文件设置中,我选择了 mysql2.sqlite,它在创建独立 Windows 但不适用于 android 时添加到文件夹中。该应用程序安装在移动设备上,但即使我在安装前手动将其添加到文件夹中,它也无法连接到数据库。
我做错了什么?
【问题讨论】: