
I have build the project but when I run It, Add or Delete an Entry and then close the apz.
I start my project up again and no Added or Deleted Entry's.
It just shows the entry's on first build.
It's as if it's reading the first file it added on first run GamesList.db.
It wont show my Added and Deleted entrys.
Any sugestions
This is on Startup
--##############################################################################################################
-- ORIGINAL ----
if not Folder.DoesExist("C:\\My ZX Spectrum Catalogue Games")then
Folder.Create("C:\\My ZX Spectrum Catalogue Games");
end
File.Copy("\\AutoPlay\\Docs\\GameList.db", "C:\\My ZX Spectrum Catalogue Games", true, true, false, true, nil);
--##############################################################################################################
sDatabaseFile = _SourceFolder .. "\\AutoPlay\\Docs\\GameList.db";
This is on the Save button on Click
function Escape (sSourceString)
sSourceString = String.Replace(sSourceString, "'", "''", false);
return sSourceString;
end
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-- Get information from input objects and store
-- in variables to transfer to database
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sName = Input.GetText("Input_Name");
sURL = Input.GetText("Input_URL");
sUsername = Input.GetText("Input_Username");
sPassword = Input.GetText("Input_Password");
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-- Insert any escape sequences needed
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sName = Escape(sName);
sURL = Escape(sURL);
sUsername = Escape(sUsername);
sPassword = Escape(sPassword);
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-- If we are creating a new record, insert at the next available
-- position, otherwise insert at the current record's position
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if bNewRecord then
SQLite.Query(db,"insert into Websites values(NULL, '" .. sName.."', '"..sURL.."', '"..sUsername .."', '"..sPassword.."')");
nLastError = Application.GetLastError();
if nLastError ~= SQLite.OK then
Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());
end
else
SQLite.Query(db,"insert or replace into Websites values('" .. nRecordID .. "', '" .. sName.."', '"..sURL.."', '"..sUsername .."', '"..sPassword.."')");
nLastError = Application.GetLastError();
if nLastError ~= SQLite.OK then
Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());
end
end
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-- Jump back to the main page
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Page.Jump("Main Page");