Save a Sqlite file by SaveAsDialog

I will save a Sqlite file on a place selected by SaveAsDialog and have try it as follow:

[code]Dim dialog As SaveAsDialog
Dim file As FolderItem
Dim FileNmae As String
dialog = New saveAsDialog
dialog.suggestedFileName="Work.sqlite”
file = dialog.ShowModal
FileName = File.NativePath

Dim DBase As New SQLiteDatabase
DBFile = DBFolder(FileName)
If not DBBestand.exists then
DBase.DatabaseFile = DBFolder(FileName)
If DBase.CreateDatabaseFile Then
SQL=“CREATE TABLE Test (Name TEXT)”
Dbase.SQLExecute(SQL)
Dbase Close
End If
End If [/code]

But the Sqlite File is always stored in the same folder as the program.

What is wrong?

what is DBFolder?

DBase.DatabaseFile = file

should do it. You don’t need to query NativePath here.