C++--遍历SQLite数据库下的所有表名 .

char szSqlCmd[SQL_LENGTH] = {0};  /* SQL缓存 */

sprintf(szSqlCmd, "select name from sqlite_master where type='table' order by name");
sqlite3_command cmd( *conn, szSqlCmd );
sqlite3_reader rdr = cmd.executereader();

// 循环读取所有数据
vector<string> vecStrTableName;
while ( rdr.read() )
{
    vecStrTableName.push_back(rdr.getstring(0));          
}

 

参考:http://blog.csdn.net/zlQQhs/article/details/8526354

posted @ 2013-05-08 10:04  jdfemqi  阅读(1006)  评论(0编辑  收藏  举报