SqlOpenDatabase: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
SqlOpenDatabase(''filename'', ''version'', ''fullname'', ''maxSize'')
SqlOpenDatabase(''dnName'')


== Description ==
== Description ==


SqlOpenDataBase is used to create and open SQLite databases. filename is the actual name of the file. version is the version number (optional). Used on file creation. Set to "1.0" if no value supplied.. fullname is a long description of the file. (optional). Used on file creation. Set to filename if no value supplied., maxsize is the maximum number of records (optional). Used on file creation. Set to 1,000,000 if no value supplied.
SqlOpenDataBase is used to create and open SQLite databases.  


For more information, see Tech Note 15.
''dbName'' is the name of the database. If ''dbName'' does not exist, it is created. The database is created in temporary memory, unless the name is ''localStorage''.
 
For more information on SQLite, see [[Using SQLite]].


== Example ==
== Example ==
Line 11: Line 13:
<pre>
<pre>
Rem SqlOpenDatabase sample
Rem SqlOpenDatabase sample
DB = SqlOpenDatabase("customers.db","1.0","My Customer Database")
DB = SqlOpenDatabase("customers.db")
If DB=0 Then MsgBox "Could not open. "
If DB.version <> "" Then
  Print "Database version is " & DB.version
Else
  print "Database not found."
End If
</pre>
</pre>


Line 18: Line 24:


<pre>
<pre>
(the database is created if it did not exist)
Database version is 1.0
</pre>
</pre>


Line 24: Line 30:


[[sql|Sql]]
[[sql|Sql]]
[[SQLite Reference]]
[[Using SQLite]]


[[Category:Language Reference]]
[[Category:Language Reference]]


[[Category:Miscellaneous]]
[[Category:Miscellaneous]]

Latest revision as of 14:46, 28 April 2024

SqlOpenDatabase(dnName)

Description

SqlOpenDataBase is used to create and open SQLite databases.

dbName is the name of the database. If dbName does not exist, it is created. The database is created in temporary memory, unless the name is localStorage.

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

Related Items

Sql

SQLite Reference

Using SQLite