SqlOpenDatabase: Difference between revisions
Jump to navigation
Jump to search
Created page with "SqlOpenDatabase(''filename'', ''version'', ''fullname'', ''maxSize'') '''Description''' SQLOPENDATABASE is used to create and open SQLite databases. filename is the actual n..." |
|||
(18 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
SqlOpenDatabase('' | SqlOpenDatabase(''dbName'') | ||
== Description == | |||
SqlOpenDataBase is used to create and open SQLite databases. It works with both the SQLite WASM library and the Cordova SQLite plugin. | |||
''dbName'' is the name of the database. If ''dbName'' does not exist, it is created. The database is created in localStorage by default. If another name is supplied, it is created as that name - but will not persist if the app is restarted. | |||
For more information on SQLite, see [[Using SQLite]]. | |||
== Example == | |||
<pre> | <pre> | ||
Rem SqlOpenDatabase sample | |||
DB = SqlOpenDatabase("customers.db" | DB = SqlOpenDatabase("customers.db") | ||
If DB.version <> "" Then | |||
Print "Database version is " & DB.version | |||
Else | |||
print "Database not found." | |||
End If | |||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Database version is 1.0 | |||
</pre> | </pre> | ||
== Related Items == | |||
[[sql|Sql]] | |||
[[SQLite Reference]] | |||
[[Using SQLite]] | |||
[[Category:Language Reference]] | |||
[[ | [[Category:Miscellaneous]] |
Latest revision as of 14:05, 28 August 2024
SqlOpenDatabase(dbName)
Description
SqlOpenDataBase is used to create and open SQLite databases. It works with both the SQLite WASM library and the Cordova SQLite plugin.
dbName is the name of the database. If dbName does not exist, it is created. The database is created in localStorage by default. If another name is supplied, it is created as that name - but will not persist if the app is restarted.
For more information on SQLite, see Using SQLite.
Example
Rem SqlOpenDatabase sample DB = SqlOpenDatabase("customers.db") If DB.version <> "" Then Print "Database version is " & DB.version Else print "Database not found." End If
Output
Database version is 1.0