Thanks again to Ulrich B and Emile S for helping me identifying errors while working through the Introduction to Programming with Xojo Book. I have managed to work right through to Databases and got many errors but with their tips I fixed them all and the Address Book finally worked.
My only confusion with the database example was - Where is my database file saved and what is its name?
The App uses the following Method (CreateDatabase) to create one if not present
MyDBFile = SpecialFolder.ApplicationData.Child(“Ch12”)
If MyDBFile <> Nil Then
MyDatabase = New SQLiteDatabase
MyDatabase.DatabaseFile = MyDBFile
If MyDatabase.CreateDatabaseFile() Then
If MyDatabase.Connect() Then
CreateSchema
Return True
Else
Return False
End If
Else
Return False
End If
End If
Thanks Albin, Found it.
The link helped to further understand other paths.
I am using Windows 8.1
The location it was saved maybe for security purposes, If I am not concerned on security, is it possible to save it on the default folder the project is saved without being specific as the app may need to move around to different locations since it can be portable?
If it can how to code it?
Realize that this might not work at runtime on all OS’s. In Windows, for example, this folder is NOT writeable. It is recommended that you use SpecialFolder.ApplicationData and if you want it to be used by multiple users SpecialFolder.SharedApplicationData.
When I used MyDBFile = GetFolderItem("").Child(“Ch12”) I realised it was temporally created during run time.
I found this in the library that worked.
MyDBFile = SpecialFolder.CurrentWorkingDirectory.Child(“Ch12”)
Hope it does not give me any problems I am not aware.
Best I use the example used in the eBook before I get any further confused.
MyDBFile = SpecialFolder.ApplicationData.Child(“Ch12”).
Thanks all for your feedback.