This code works
Dim dbPath as string
Dim f as folderitem
dbPath=“C:\Files\WarrantyAutomation\WarrantyAutomation”
f = New FolderItem(dbPath)
dim db as new SQLiteDatabase
app.db.DatabaseFile=f
If the database is a property of the App then I get a Nil databse error using the code below.
Dim dbPath as string
Dim f as folderitem
dbPath=“C:\Files\WarrantyAutomation\WarrantyAutomation”
f = New FolderItem(dbPath)
app.db.DatabaseFile=f
Norman_P
(Norman P)
2
Note in the former you did
dim db as new SQLiteDatabase
but not in the latter
try
dbPath="C:\\Files\\WarrantyAutomation\\WarrantyAutomation"
f = New FolderItem(dbPath)
app.db = new SQLiteDatabase // <<<<<<<<<<<
app.db.DatabaseFile=f
Bob_Keeney
(Bob Keeney)
3
The first one works because you’ve defined db as a local property. In the second one you’ve not created a new instance of SQLiteDatabase.
So it should be:
dbPath=“C:\Files\WarrantyAutomation\WarrantyAutomation”
f = New FolderItem(dbPath)
app.db = new SQLiteDatabase
app.db.DatabaseFile=f
Oops, Norman beat me to the punch.