I have my specialFolderPath and I put it into a variable but when I look under the variables tab, tDatabasePath is empty. Why is it empty? I'm still relatively new to LiveCode so I might be missing something big.
When I try to run this code, I get an error on databaseGetIngredients on the line "put revDataFromQuery..." saying "revdberr invalid connection id". I assume that has to do with the empty tDatabasePath?? How can I get it to work? Am I missing something?
Please help me
Code: Select all
on databaseConnect
local tDatabasePath, tDatabaseID
## The database must be in a writeable location
put specialFolderPath("Document") & "/Users/S17600087/Document/ingredients2.sqlite" into tDatabasePath
put revOpenDatabase("sqlite", tDatabasePath,,,,) into tDatabaseID
## Store the database id so other handlers can access it
end databaseConnect
on databaseGetIngredients
local tSQLQuery
put empty into tSQLQuery
## Query the database for details to be displayed in the field
put "SELECT * FROM ingredients where name = 'tName'" into tSQLQuery
put revDataFromQuery(tab,return,tDatabaseID,tSQLQuery) into field "Outcome"
end databaseGetIngredients