Wow, thanks Nypyren and Alberth for the info. I had no idea there was a way to see what variables' values were being set to in real time or any of that. And I had no idea there were compiler settings that might help. Now that I at least have an idea of what to research (like how to do these things in my IDE) I definitely have some options now. This was what I was looking for (in particular Nypyren's explanation of the general process, which involves a lot of stuff I didn't even know was possible, lol). And yes, I understand that normally actual code and error messages help (lol, sorry frob) but my question was a general "how do I go about fixing this type of error" and not a "please help! fix this for me!". :)
But while we're on the subject, what I have is:
sqlite3_prepare_v2(db, sql.c_str(), -1, statement, NULL);
where db and statement are SQLite handles (to the database and prepared statement objects) and sql is an std::string. The SQLite docs say if the third parameter (the query string length in bytes) is negative, it'll read till the end of the string (so that's the -1). And the last parameter (the NULL) is an optional callback to free the string after the SQL stuff is done. I don't really understand why this would be necessary, and apparently neither does anyone else who writes examples, because in every example I've seen this is always NULL or 0. And that makes sense, because I'm not using the "new" keyword to create my strings (so I don't have to do "delete" at the end anyway...right? Or am I out in left field on that one?).
Now I'm having trouble finding the exact error message again, but it was "access violation" with a bunch of numbers, like I said. And of course Google that, and you'll find everything that has nothing to do with the problem at hand, cuz it's that general. So I started investigating the IDE's debug tools, and managed to get this: "#0 0x46a5c0 sqlite3LockAndPrepare (db=0xe02e00, zSql=0x8d2434 "INSERT INTO table('text') (C:\path\to\\sqlite3.c:116069)
#1 0x46a7e2 sqlite3_prepare_v2 (db=0xe02e00, zSql=0x8d2434 "INSERT INTO table('text') (C:\path\to\sqlite3.c:116151)" and from here it points to the line in my code where I called the line above.
So my first thought was "duh, there's no space between the table name and the paren, so it's an SQL syntax error" but I looked in my code and I did put a space there, and even after I changed the statement a bit it still shows that same string. And because the stack trace points to something in SQLite's code, I'm guessing it's something SQLite itself is doing with what I gave it. So at the end of all that, I know which part of the code is failing, but still don't know why (which is why the question was more general - I wanted to know how to fix stuff like this, not just "here, you fix it" lol). Hope that makes sense. :)
But anyway, it sounds like I got my answer to the original question (there are debugging tools in my IDE that I never knew about). But beyond that, I'd sure appreciate an example of how to use sqlite_prepare_v2 correctly. lol thanks again.