A Andras Active Member Licensed User Longtime User Jan 16, 2012 #1 Reluctantly moving from CSV files to .DB, I find that the SQLExample program stalls on the following: pnlToolBox.Top=Activity.Height-pnlToolBox.Height Commenting the statement out throws up further similar errors in the same Sub. I presume that something hasn't been initialised, but what? Or am I just being a bit slow here? John
Reluctantly moving from CSV files to .DB, I find that the SQLExample program stalls on the following: pnlToolBox.Top=Activity.Height-pnlToolBox.Height Commenting the statement out throws up further similar errors in the same Sub. I presume that something hasn't been initialised, but what? Or am I just being a bit slow here? John
Erel B4X founder Staff member Licensed User Longtime User Jan 16, 2012 #2 Are you referring to the example from the Beginner's guide? Upvote 0
A Andras Active Member Licensed User Longtime User Jan 16, 2012 #3 Yes - the section around pp 150 or so in the Beginners' Guide, and the sample included in the downloaded information. John Upvote 0
Yes - the section around pp 150 or so in the Beginners' Guide, and the sample included in the downloaded information. John
klaus Expert Licensed User Longtime User Jan 16, 2012 #4 I just tested the SQLExample from the forum and it works. So you must be more precise on: - what you did - what error do you get - did you modify the program etc. Best regards. Upvote 0
I just tested the SQLExample from the forum and it works. So you must be more precise on: - what you did - what error do you get - did you modify the program etc. Best regards.
A Andras Active Member Licensed User Longtime User Jan 16, 2012 #5 Oh dear! We seem to have the famous unrepeatable error! After giving the same error message four times in a row previously it now works perfectly, and I feel rather silly! It must have been feeling lazy on Monday! Thanks for your help! John Upvote 0
Oh dear! We seem to have the famous unrepeatable error! After giving the same error message four times in a row previously it now works perfectly, and I feel rather silly! It must have been feeling lazy on Monday! Thanks for your help! John
A Andras Active Member Licensed User Longtime User Jan 21, 2012 #6 I'm continuing to have problems here, probably because I've misunderstood something fundamental! I'd assumed that the data which is displayed in the SQL Example program is that which is contained in the persons.db file associated with it, and that therefore changing the contents of that data file in SQLite would change what appears in the SQL Example program. Not so, however! Changes made with SQLite to the persons.db file have no effect on the data displayed in the program, and changes made when the program is running do not appear in the file. Clearly the real data is being stored somewhere else! Where? John Upvote 0
I'm continuing to have problems here, probably because I've misunderstood something fundamental! I'd assumed that the data which is displayed in the SQL Example program is that which is contained in the persons.db file associated with it, and that therefore changing the contents of that data file in SQLite would change what appears in the SQL Example program. Not so, however! Changes made with SQLite to the persons.db file have no effect on the data displayed in the program, and changes made when the program is running do not appear in the file. Clearly the real data is being stored somewhere else! Where? John
NJDude Expert Licensed User Longtime User Jan 21, 2012 #7 If you edit the DB using an SQLite editor it will save the data to the DB, BUT, it won't show up on the app, that's because the DB is embedded on the app and if you look at the code you will see that the DB will be created IF IT DOESN'T EXISTS, so, you will have to uninstall the app and then reinstall it in order to clear ALL files. Code: Copy If File.Exists(File.DirDefaultExternal, "SomeDatabase.db") = False Then File.Copy(File.DirAssets, "SomeDatabase.db", File.DirDefaultExternal, "SomeDatabase.db") End If The code above is an example, the "SomeDatabase.db" will be copied from the assets directory to the device if it doesn't exist, but, if you modify the DB manually not from within the app it won't copy it because already exists, therefore, any changes will not show up. Last edited: Jan 21, 2012 Upvote 0
If you edit the DB using an SQLite editor it will save the data to the DB, BUT, it won't show up on the app, that's because the DB is embedded on the app and if you look at the code you will see that the DB will be created IF IT DOESN'T EXISTS, so, you will have to uninstall the app and then reinstall it in order to clear ALL files. Code: Copy If File.Exists(File.DirDefaultExternal, "SomeDatabase.db") = False Then File.Copy(File.DirAssets, "SomeDatabase.db", File.DirDefaultExternal, "SomeDatabase.db") End If The code above is an example, the "SomeDatabase.db" will be copied from the assets directory to the device if it doesn't exist, but, if you modify the DB manually not from within the app it won't copy it because already exists, therefore, any changes will not show up.
A Andras Active Member Licensed User Longtime User Jan 22, 2012 #8 Brilliant - fixed it! I'd misunderstood the purpose of the Copy command, but all is now clear. Thanks! John Upvote 0
Brilliant - fixed it! I'd misunderstood the purpose of the Copy command, but all is now clear. Thanks! John