Quoting from the SQLite web page
” If the page_size pragma is used to specify a new page size just prior to running the VACUUM command and if the database is not in WAL journal mode then VACUUM will change the page size to the new value.”
My SQLite 3.7 database is running on 1024 page size and since Im using windows I thought I would try 4096 and see what would happen. I cant for the life of me get it to change, could someone please look at my code and tell me where Im screwing up, thank you
Dim connection As New SQLite.SQLiteConnection(conectionString)
connection.Open()
Dim oMainQueryR As New SQLite.SQLiteCommand
oMainQueryR.Connection = connection
oMainQueryR.CommandText = ("PRAGMA page_size=4096")
oMainQueryR.ExecuteNonQuery()
oMainQueryR = New SQLite.SQLiteCommand
oMainQueryR.Connection = connection
oMainQueryR.CommandText = ("vacuum")
oMainQueryR.ExecuteNonQuery()
connection.Close()
The vacuum comand runs OK its just that it dosent reset the pagesize, and Im not running WAL
The problem was the encryprion, take that off and the code works as bellow. Thank you to C.L who made me think ! If you dont have encryption then just delete the 2 references to ChangePasswords. Interestingly the database grew by about 10% setting the Page Size to 4096 from default 1024.