Thanks Stephan for the help, with a little bit of reading and a lot of your
help, I have come to understand how opening a data base file in SQLite is done.
Here is a code I came up with:
void mydb(){
std::string db_name("test");
std::string my_name("Programmer");
int my_age = MAX_INT;
std::string vfs("win32");
.....
rc = sqlite3_open_v2(dbName.c_str(), &db, SQLITE_OPEN_READWRITE |
SQLITE_OPEN_CREATE, vfs.data());
if(rc != SQLITE_OK){
sqlite3_close(db_name);
std::cout << "naaa, you ain't got it yet... press any key and keep trying." <<
std::endl;
std::cin.get();
exit(-1);
} else {
std::cout << "Welcome to a whole new world!" << std::endl;
std::cin.get();
}
....
sqlite3_close(db_name);
cout << "Good bye!" << endl;
return 0;
}
Now, my next step is to create data tables, but that will be on another email.
----- Original Message -----
From: Stephan Beal
Sent: 06/17/12 11:25 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - int sqlite3_open_v2() question
On Sun, Jun 17, 2012 at 5:14 PM, Arbol One <[email protected]> wrote: >
rc = sqlite3_open_v2(db_name.c_str(), *??1*, &db, SQLITE_OPEN_READWRITE > |
SQLITE_OPEN_CREATE, *??2*); > That is not the signature for open_v2:
http://www.sqlite.org/c3ref/open.html > if(rc != SQLITE_OK){ > std::cout <<
"error one" << std::endl; > exit(-1); > Don't forget sqlite3_close() here! It
must be called even on error. > What do I input as *??1* and *??2* ? and do I
need to grab ??1 to later > use it? > You seem to have inserted an extra
argument (??1) where the db handle (&db) goes. The final parameter should be
NULL unless you specifically know otherwise (you would know if that were the
case). -- ----- stephan beal http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal _______________________________________________
sqlite-users mailing list [email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users