killoattack.blogg.se

How to use sqlite database
How to use sqlite database






#How to use sqlite database code#

We could put all the code in the button script but I prefer to keep all the database handlers together on the card script. In this case we will define sDatabaseID in the card script, above the handlers that use it. Script local variables are defined outside of any handler, they are then accessible to the scripts of all handlers that appear after the variable definition.

how to use sqlite database

We also need the commnd setDatabaseID, which stores the database connection id in a script local variable, and the function getDatabaseID, which returns the database connection id so we can use it. # Store the database id so other handlers can access it Put revOpenDatabase( "sqlite", tDatabasePath,, ,, ) into tDatabaseID # If the database does not already exist it will be created Put specialFolderPath ( "documents" ) & "/runrevemails.sqlite" into tDatabasePath # The database must be in a writeable location Select the "Connect to database" button, open the script editor and set the script of the button to on mouseUpĪdd the databaseConnect handler to the card script. The command will create an SQLite database if it does not already exist.

how to use sqlite database

We store the connection id as we will need it when we want to communicate with the database. This command establishes a connection with the database and returns the connection id.

how to use sqlite database

To do this we use the revOpenDatabase command. The first thing we need to do is establish a connection with the database.






How to use sqlite database