SqlExport: Difference between revisions
Jump to navigation
Jump to search
Created page with "SQLEXPORT(''db''[, ''filename''[, ''function'']]) '''Description''' The SQLExport function converts an SQLite database to a JSON object. This object can then be sent to anot..." |
No edit summary |
||
Line 23: | Line 23: | ||
MsgBox JSON.stringify(DBjson) | MsgBox JSON.stringify(DBjson) | ||
End Function | End Function | ||
<pre> | </pre> | ||
'''Output''' | '''Output''' |
Revision as of 23:47, 8 July 2012
SQLEXPORT(db[, filename[, function]])
Description
The SQLExport function converts an SQLite database to a JSON object. This object can then be sent to another server using AJAX.
To include your own filename, include it as the second parameter. If nothing is suppled, ‘default’ will be used.
Since it can take some time to do the conversion with large databases, the SQLExport returns immediately and continues to run in the background. When it is complete, function is called in your app.
SQLExport is used by the IDE to convert databases listed in the manifest to JavaScript files which are included in the project.
Example
Function btnSQLExport_onclick() NSB.ShowProgress("Exporting database...") DBjson=SQLExport(DB, exportComplete) End Function Function exportComplete() NSB.ShowProgress(False) MsgBox JSON.stringify(DBjson) End Function
Output
(a MsgBox showing the converted data as a string)
Related Items