User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

de:dbopen [2016/01/01 22:37] (current)
Line 1: Line 1:
 +===== DBOpen =====
 +==== Format ====
 +**dbopen** //​SQLiteFile//​\\
 +**dbopen** ( //​SQLiteFile//​ )
 +==== Description ====
 +Open an SQLite database file.  If the file does not exist then create it.
 +==== Example ====
 +#database foo - create a database, populate a table, open a recordset and read data from table.
 +# create a new database file or open it
 +dbopen "​dbtest.sqlite3"​
 +# delete old foo table - trap error if new database
 +onerror errortrap
 +dbexecute "drop table foo;"
 +# create and populate
 +dbexecute "​create table foo (id integer, words text, value decimal);"​
 +dbexecute "​insert into foo values (1,'​one',​3.14);"​
 +dbexecute "​insert into foo values (2,'​two',​6.28);"​
 +dbexecute "​insert into foo values (3,'​three',​9.43);"​
 +# open a recordset and loop through the rows of data
 +dbopenset "​select * from foo order by words;"​
 +while dbrow()
 + print dbint(0) + dbstring(1) + dbfloat(2)
 +end while
 +# wrap everything up
 +# accept error - display nothing - return to next statement
 +will display
 +==== See Also ====
 +[[DBClose|DBClose]],​ [[DBCloseSet|DBCloseSet]],​ [[DBExecute|DBExecute]],​ [[DBFloat|DBFloat]],​ [[DBInt|DBInt]],​ [[DBOpenSet|DBOpenSet]],​ [[DBRow|DBRow]],​ [[DBString|DBString]]
 +==== External Links ====
 +More information about databases in general and SQLite specifically can be found at [[http://​|SQLite Home Page]] and [[http://​​wiki/​SQL|SQL at Wikipedia]].
 +==== New To Version ==== 
de/dbopen.txt ยท Last modified: 2016/01/01 22:37 (external edit)