For several weeks, I have been working on a web app to run on a Raspberry Pi. I put both the compiled program and its SQLite database in the /home/pi/EZwithPi folder and everything worked fine until I uploaded a new version of the program to the rPi this morning. Since then I get a "Database not found" message when the session tries to connect to the database. If I run the program in the remote debugger it connects properly. I have been using this code for the connection:
if TargetARM #if DebugBuild f = GetFolderItem("../") #Else f = GetFolderItem("") #Endif #Endif if f.exists Then db.DatabaseFile = f.Child("EZPiData.sqlite") if not db.Connect then MsgBox "Could not connect to database" else MsgBox "Database not found" end if
Thinking the problem was with the GetFolderItem(""), I changed the code to
f = SpecialFolder.UserHome.Child("EZwithPi")
but that didn't work as it returned <root>/EZwithP/i instead of /home/pi/EZwithPi/ (I filed a bug report about that.) Next I hard coded it to
f = GetFolderItem("/home/pi/EZwithPi")
with exactly the same result as as GetFolderItem("").
Neither starting the app with /etc/rc.local on boot up or starting it in Terminal works.
Why does it work in the remote debugger (which is in a child of the app's folder) but not when compiled? Why has this worked for weeks without problem until today? Any update to the Pi operating system was automatic with no input from me and the code above goes back to the start of developing this app. Is there a work around other than moving the database to a different folder? Being a Linux newbie, there are probably better folders that the user home one.
Any help with this will be most appreciated.