XML Posted April 30, 2018 Share Posted April 30, 2018 (edited) Hello guys, I once heard that there is a way to connect to Internal.db, And get/set values in it using: dbQuery - dbExec .. etc I tried to get values in it, But i get this error: There is no such table called 'accounts' So my question is, How to do it ? Is there anyone did it before or knows how to do it ? Edited April 30, 2018 by XML Link to comment
Moderators IIYAMA Posted May 1, 2018 Moderators Share Posted May 1, 2018 Before you can store or receive data, it requires tables as containers. Not the best site, but it explains the basics on how to create a table. http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_create_table.asp.html Also handy: http://www.tech-recipes.com/rx/36940/sql-server-check-if-table-or-database-already-exists/ Link to comment
XML Posted May 1, 2018 Author Share Posted May 1, 2018 Yes i know that, I know how to create a table and store or receive data, But what i mean is, internal.db that contains userdata and accounts .. etc, The main database, That you need to use set/getAccountData to store or receive data from it. But i want to know how to connect to it and get all of the data using: dbQuery - dbExec That's what i mean. Link to comment
Moderators IIYAMA Posted May 1, 2018 Moderators Share Posted May 1, 2018 (edited) hmm good quest. (to be honest never done it with the internal db, I did misread that part) You should start with viewing the structure of the db itself, with for example this tool: https://github.com/sqlitebrowser/sqlitebrowser This will also tell you if the db is protected (or the data is protected) in anyway. If everything is fine, then you should be able to connect with it the same way as with a regular db. If that doesn't work and yet your viewer does do the job, then you might need to convert the db to another version. Edited May 1, 2018 by IIYAMA Link to comment
XML Posted May 2, 2018 Author Share Posted May 2, 2018 I already have that tool and i opened the db with it, Without any problems. But when i try to connect to internal.db, Debug says: There is no such table .. etc So i tried to do: CREATE TABLE .. etc And see if it'll work or not, It worked but it returns only 2 booleans (true). It should return the data in the 'accounts' or 'userdata' or whatever table i want. Link to comment
Moderators IIYAMA Posted May 2, 2018 Moderators Share Posted May 2, 2018 Your internal db should already have tables. Try to re-save the database. Link to comment
MIKI785 Posted May 2, 2018 Share Posted May 2, 2018 (edited) You can't access the internal.db from within Lua. You may only access .db files located in resources or in the 'global' database directory as described on the dbConnect wiki page. The only way to connect to internal.db is to do it externally or make a module that will make it accessible. Another way could be to for example to use the FileSystem module and copy the internal.db to your resource's directory every once in a while. I'm not sure if you could access it directly using that module. Edit: It's possible that a symbolic link would do the trick, that would most likely be the best solution. Edited May 2, 2018 by MIKI785 Link to comment
XML Posted May 4, 2018 Author Share Posted May 4, 2018 (edited) You mean to do a shortcut of the internal.db ? I already did that, And i got this error when i tried to do 'dbQuery': There is no such table .. etc Edited May 4, 2018 by XML Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now