Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:09:56+00:00 2026-06-02T22:09:56+00:00

In the SQLite3DB.cpp, I have some code blow: void QueryJsFileBegin() { SQLite3Initilize(); } bool

  • 0

In the SQLite3DB.cpp, I have some code blow:

   void QueryJsFileBegin() {
       SQLite3Initilize();
    }

    bool QueryJsFileNext(JS_FILE* js_file) {
        int err = sqlite3_step(stmtQueryJSFILE);
        if (err != SQLITE_ROW) 
            return false;
        // get data.
        return true;
    }

    void QueryJsFileEnd() {
        sqlite3_reset(stmtQueryJSFILE);
    }

These works fine when I test them in the SQLite3DB.cpp

void test () {
    db::JS_FILE js_file;
    for (db::QueryJsFileBegin(); db::QueryJsFileNext(&js_file); db::QueryJsFileEnd()) {
        MessageBoxA(NULL, js_file.js_file_name_.c_str(), "", 0);
    }
}

but When I use these in the other cpp(like main.cpp) file, It always return the first row and dead loops. Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:09:57+00:00Added an answer on June 2, 2026 at 10:09 pm

    Because, in the step part of for, you’re running sqlite3_reset(), so it is closed after first row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am DBD::SQLite to insert some data in SQlite3 db using perl. I have
I have written the following code for inserting video bytes into the database DBAdapter.java
I have this code: #import SQLiteDB.h @implementation SQLiteDB @synthesize db, dbPath, databaseKey; @end //--------------
void max_min(sqlite3 *db) { //call back********* int i, ncols; sqlite3_stmt *stmt; char *sql; const
I'm trying to do it class Foo { static int ReadSelfFromBase(void *userarg, int argc,
Using sqlite3, I have two tables: products, orders. I want to know how many
while(sqlite3_step(compiledStatement) == SQLITE_ROW) { // Read the data from the result row NSLog(@WHILE IS
Using sqlite3, I have a table that looks like this: +---------+-----------------+----------+-----------+--------+ | ArtId |
I need to run C++ code via eclipse which has SQlite. I can run
I have many tables in Sqlite3 db and now I want to export it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.