Hi All.
This is nuts.
I am trying to get the records in an encrypted database (yes I am getting better at the encryption stuff (smile)) but even though I know there are records I get a nilobjectexception.
When I go to read the database this is what I have as a method:
[code]Var dbFile As FolderItem //set database variable
dbFile = GetOpenFolderItem("") // let the person choose the database. I have filtered what could be chosen
If dbFile <> Nil Then // if it exists then do the following
Var db As New SQLiteDatabase //create an instance of the database
db.DatabaseFile = dbFile
db.EncryptionKey = “xxxxxxxxxx”
Try
db.Connect //try to connect
MessageBox("Connected to " + dbFile.Name)
LoadWorkEvents //this is the method I call to get the recordset
Catch error As DatabaseException
MessageBox("Error: " + error.Message) //what is the error
return
End Try
else
if dbFile.Exists = False Then
MessageBox “The database does not exist”
Return
else
end if
End If[/code]
This is what I do in the LoadWorkEvents method.
[code]mainWindowListbox.DeleteAllRows
dim sql as string //set up my sqlite string query
dim workRS as recordset
sql = “SELECT * from Activity ORDER BY groupType”
workRS = db.SQLSelect (sql)
IF dbError then return // look for an error with the Module dbError
if workRS <> NIL then
while not workRS.EOF
mainWindowListbox.AddRow ( workRS.Field(“groupType”).StringValue, _
workRS.Field(“Name”).stringValue, _
workRS.Field(“startTime”).stringValue, _
workRS.Field(“endTime”).stringValue, _
workRS.Field(“Notes”).stringValue, _
workRS.Field(“seconds”).stringValue, _
workRS.Field(“minutes”).stringValue, _
workRS.Field(“hours”).stringValue)
'mainWindowListbox.RowTagAt(mainWindowListbox.LastIndex) = workRS.Field("ID").IntegerValue
workRS.MoveNext
wend
workRS.close
end if[/code]
I have verified that there is, indeed, data in the sqlite database.
Any ideas, hints, tips?
Regards