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

  • SEARCH
  • Home
  • 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 3312062
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:57:00+00:00 2026-05-17T21:57:00+00:00

I have a program that accesses a database using SQLite. When I open a

  • 0

I have a program that accesses a database using SQLite. When I open a OpenFileDialog or a SaveFileDialog before I do the SQLite call:

result = sqlite3_prepare_v2(databaseConnection,converted,10000,&stmt,&strptr);

and choose “Cancel”, everything works okay (result == SQLITE_OK) but when I choose “Open”, even if I don’t do anything with the dialog’s return file, it breaks (result == SQLITE_ERROR). Do you have any idea why this might be happening?

Thanks so much for your time!

EDIT: Here is the code I am using:

OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
openFileDialog1->ShowDialog();
sqlite3_stmt * stmt;
const char * strptr;
sqlite3 * databaseConnection;

int result = sqlite3_open("virtualpatient_chat.db", &databaseConnection);

if (result != SQLITE_OK) return;
result = sqlite3_prepare_v2(databaseConnection,"SELECT * from mappings;",10000,&stmt,&strptr);

if (result != SQLITE_OK) return;

Strangely, it won’t work in my current project but I copied and pasted it into a brand new project and the error doesn’t repeat. Now I’m just trying to figure out what the problem in my surrounding code could be…

  • 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-05-17T21:57:00+00:00Added an answer on May 17, 2026 at 9:57 pm

    I finally figured out how to fix it. Under the Properties for my dialog box, I had to set the RestoreDirectory property to true. I’m not quite sure how that fixed it unless somehow by changing the directory it made SQLite not be able to find my database file.

    Thanks for your help!

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

Sidebar

Related Questions

I have a python program that accesses a couchDB database, creates new documents and
I am developing a program in Python that accesses a MySQL database using MySQLdb.
I have a Windows Mobile program that accesses an attached device through a third-party
I have a program that gets a JSON from the server using getJSON and
I have this program that at one point accesses os.getcwd(), but some times, depending
My problem: I have a program in Flex3 that accesses a server. The program
I have a SQLite database that is created by reading some data in PDF
I have a program that accesses a device through the serial port and reads
Ok. I have an MVC2 application that accesses a WCF program, and uses that
I have a toy program that is called Test.class. It accesses a class in

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.