dbman

dbman - a SQLite Database Browser for RB. Copyright (c) 2007 - the RB Community. Extend and enhance as you wish, but be sure to release your changes under the same terms.

Changes Made
List any changes you make here. Include your name, and a summary of the changes.

12 October 2007, Bill W.
1192221017
 * First version

Code
code format="vbnet" [init] 'the name of the database being browsed/edited global dbName$, #db

'add some CSS styling call doCSS

'go to the main menu call chooseDB end

sub chooseDB 'show a menu of databases to edit

cls div chooseDB html " Select Database to Edit " files #dir, "C:\rbp\*.db"

html "" while #dir hasAnswer #dir nextFile$ html "" : link #choose, #dir name$, editDB : html "" #choose setKey(#dir name$) wend

html "" : link #choose, "New Database", editDB : html "" #choose setKey("new")

html "" end div wait end sub

sub editDB key$ 'if it's a new database, stop here if (key$ = "new") then print "Not Implemented" wait end if

'open the database dbName$ = key$ sqliteconnect #db, dbName$

call showTables "" end sub

sub closeDB key$ 'close the DB and go back to the menu #db disconnect call chooseDB end sub

sub showTables key$ 'show a menu of tables cls link #closeDB, "dbMan", closeDB print " > " + dbName$

div chooseTable html " Choose Table to Modify "

#db execute("SELECT * FROM sqlite_master") html "" while #db hasAnswer r$ = #db nextRow$(",") tableName$ = word$(r$, 2, ",") html "" : link #choose, tableName$, editTable : html "" #choose setKey(tableName$) wend end div

wait end sub

sub editTable key$ tableName$ = key$

cls link #closeDB, "dbMan", closeDB print " > "; link #editDB, dbName$, showTables print " > " + key$

div editTable html " Browsing Table: pages " #db execute("SELECT * FROM " + tableName$) render #db print "Links go here" end div

wait end sub

sub doCSS 'add some CSS so everything isn't ugly cssclass "*", "{ font-family: Georgia; font-size: 12pt; }" cssclass "h3", "{ font-size: 16pt; }" end sub code