Sub Process_Globals
Public SQL2 As SQL
Public DBDirectory, DBFileName As String
End Sub
Sub Service_Create
DBDirectory = File.DirInternal
DBFileName = "mydata.db"
End Sub
Sub Service_Start (StartingIntent As Intent)
my_sub
End Sub
Sub my_sub
Dim dato1, dato2, dato3 As String
dato1 = 1
dato2 = "Test"
dato3 = "abc"
If File.Exists(DBDirectory, DBFileName) = False Then
SQL2.Initialize(DBDirectory, DBFileName, True)
CreateDataBase
Else
SQL2.Initialize(DBDirectory, DBFileName, False) 'False .. the db is there so do not create new one.
End If
'. . . . . . .
Dim Query As String = "INSERT INTO TABLEFASE1 VALUES (?, ?, ?)"
SQL2.ExecNonQuery2(Query, Array As String(dato1,dato2,dato3))
End Sub
Sub CreateDataBase
Dim Query As String
Query = "CREATE TABLE TABLEFASE1 (dato1 INTEGER, dato2 TEXT, dato3 TEXT)"
SQL2.ExecNonQuery(Query)
End Sub