Hey all,
I’m trying to get a DB added to my web application. In short what I believe I’ve done is created a function to check of and, if neccessary, create a SQLITE database for my application when a new session / Instance of the application is launched. As you can see from the screenshots below, It looks like my code is doing what it’s supposed to do but the database isn’t being created. Any thoughts?
SCREENSHOT
CODE
[code]// create a variable for the database file to be referenced. get the file from disk with getfolderitm
Dim dbFile as FolderItem = GetFolderItem("").Parent.Child(“LiffBoi.sqlite”)
// If The Database File Already Exists then let the user know…
if dbFile.Exists Then
exit
// If the database file DOES NOT exist…
ElseIf Not dbFile.Exists Then
// Let The User Know We Are Creating A New Database
MsgBox(“Could not find a database, Creating one now…”)
// Set the DB property in the session Equal to a new instance of a SQLite database )we know this is the session DB because we are not having to explicitly declare it)
DB = New SQLiteDatabase
// Set the database equal to the file specified in our dbFile variable
DB.DatabaseFile = dbFile
// Start a new transaction for database setup
db.SQLExecute(“BEGIN TRANSACTION”)
//Create Tables
dim StudentTableSQL as String = “”
//Execute the SQL to create the students Table
db.SQLExecute(StudentTableSQL)
//Save and exit
db.commit
db.Close
//DEBUG
dim DBLocation as String
DBLocation = dbFile.NativePath
MsgBox(“Database Created At:” + EndOfLine + EndOfLine + DBLocation)
end If[/code]