I can connect to the database, find the table, select the table, see what is in the table, but when I try to run this command in a method, it still says
… and, still talking security, you should consider storing just the hash of a password instead of the real string, especially if your database has connection to the world outside a single computer (and if it’s meant for log-ins. Not suitable if you are programming a password manager for yourself – where some encryption still would be a good idea.)
There’s a group of things that are database connections. SQLiteDatabase is the only one of them that uses a FolderItem, thus the separation. That said, you don’t have to create a variable for it, you can use thedb.DatabaseFile directly. It’s just a matter of personal preference at that point.
I’d just like to point out you will still see references to PreparedStatement classes in the documentation. They are a little convoluted, but are no longer necessary. SelectSQL and ExecuteSQL incorporate prepared statements and make them a lot easier.
No, you do have to create a new database object. What I meant was you don’t need a separate variable thedbFile. You can use thedb.DatabaseFile instead of declaring a separate thedbFile variable. It was in response to your question “Why not just have one thing?” Perhaps I misunderstood what you were asking.
Well your original code as posted in your OP, was. All I did was recast it to make it more readable and to use the automatic prepared statement feature of ExecuteSQL.
I wouldn’t bother reading up on prepared statements unless your needs for them are more complex. You’ll be led into thinking you need to do bind and prepare as separate steps when there’s no need.
you can use it this way with the constuctor thedb as New SQLiteDatabase(thedbFile)
if you subclass this SQLiteDatabase class you can add your own methods there.
its better to use singular table names.