Hello everyone,
I’m trying to get a web project off the ground with the help of ARGen and ActiveRecord. I’ve been able to load the DB successfully but the app is failing at some point when I try to load a listbox with the data from one of my tables.
After running the db file through ARGen and loading the classes on my web project, I add a build step to copy the db to the app’s parent folder for debugging.
The db file has a number of tables, but I’m interested on the one called t_need. It has a number of attributes, including stitle (TEXT) and it is already preloaded with a couple of records.
This is what I have on App’s Open() event (Console shows DB loads ok when I run it):
dim f as FolderItem = GetFolderItem("db.sqlite")
if f <> nil then
if Data.OpenDB(f) = True then
System.DebugLog "DB file loaded successfully"
else
System.DebugLog "DB file NOT loaded"
end if
end if
And this is the code I have been trying to use in the Open() event of the main page containing the listbox:
lbMain.DeleteAllRows()
For each oRecord as Data.t_need in Data.t_need.List()
lbMain.AddRow oRecord.stitle
lbMain.RowTag(lbMain.LastIndex) = oRecord
Next
When I run the code above, I get a nil object exception at the line below:
ex.Message = "Class does not have a table registered for it: " + ty.FullName
Ideas?