我是Sqlite和liveCode的新手。我需要使用LiveCode和SqlLite.Can完成一些任务。任何人都可以告诉我适用于LiveCode的Sqlite版本,以及我可以从哪里下载它,因为我在web上找不到任何关于it.Thanks的足够信息
发布于 2013-07-03 19:03:02
在LiveCode 6中执行以下操作
例如,从该堆栈中提取的以下代码片段连接到数据库AppReg3.db。如果数据库尚不存在,则创建该数据库。
gConID保存连接标识符,以便在以后的脚本中引用数据库。
# Connect button script
on mouseUp
global gConID
put revOpenDatabase("sqlite","AppReg3.db",,,,,,) into tConID
if tConID is "" then
answer warning "Problem creating or accessing database!"
else
answer information "AppReg Connected! Your connection ID is: " & tConID
put tConID into gConID
end if
end mouseUp下面创建了一个表Users
on mouseUp
global gConID
if gConID is "" then
answer information "No Database is Connected to, please go back 1 step and connect to the Database!"
exit mouseUp
end if
put "CREATE TABLE users(userID integer primary key, name text,email text,emailList boolean)" into tSQL
put revExecuteSQL(gConID,tSQL) into tTmp
handleRevDBerror tTmp
if the result is not empty then
answer warning the result
exit mouseUp
end if
answer information "Number of Tables Added: " & tTmp
end mouseUp发布于 2013-07-03 14:58:40
LiveCode中包含一个sqlite驱动程序。只需阅读revDB函数和命令即可。本教程可能会对您有所帮助:
http://lessons.runrev.com/s/lessons/m/4071/l/30516-how-to-create-and-use-an-sqlite-database
随LiveCode一起分发的当前版本为3.7.4
https://stackoverflow.com/questions/17440837
复制相似问题