Examples in documentation

Hi all,

I just had a go at databases and used the examples in the documentation, e.g.

Creating a SQLite Database
The following code creates a SQLite database and uses SQLExecute to create a table.

[quote]Dim dbFile As New FolderItem(“MyDB.sqlite”)

Dim db As REALSQLDatabase
db = New REALSQLdatabase
db.DatabaseFile = dbFile

If db.CreateDatabaseFile Then
Dim sql As String
sql = “CREATE TABLE Team (ID INTEGER NOT NULL, Name TEXT, Coach TEXT, City TEXT, PRIMARY KEY(ID));”
db.SQLExecute(sql)
Else
MsgBox("Database error: " + db.ErrorMessage)
End If[/quote]

Except unless you add a db.commit only an empty database file is created that is flagged as corrupted in other SQL editors.

Am I wrong in thinking there should be a db.commit added to the example?

Same is true for the RecordSet documentation.

Hi Markus,

It appears that a commit command is added to code when it is in a ‘Begin Transaction’ sequence.

Here is a link where this was discussed: Begin Transaction .

The Commit is likely needed with the deprecated RealSQLDatabase, but it is not needed with SQLiteDatabase.

Whereabouts in the docs did you see this example?

It was in my Dash docset, however I found that it was still on the 2013.0200.4.1 (?) docset. Sorry about that!