Hello!

I wonder how and where can I see a sqlite database that i have created in c++, if it is possible at all? I would like to see if the db exist, and what are the inputs, to check if i have inserted valuations properly..

Thank you.

T :)

Recommended Answers

All 4 Replies

1) check to see if db exists? That would be like checking if any other file exists, e.g. attempt to open it and if open failes then the db does not exist.

2) write a query to get all results, e.g. "SELECT * FROM MyTable" then view the results returned.

1.) i used:

fopen ("newdb", "r+");

to open it, I wasnt notified about any error. It doesn't really open a new window consisted of my db, does it?

I'm really new att all this, I feel like I'm totally lost :S


2) should i type "SELECT * FROM MyTable" into sqlite.exe command line or as a code in c++ by using sqlite_exec ?

>>to open it, I wasnt notified about any error.

FILE* fp = fopen(("newdb", "r+");
if( fp == NULL)
{
   cout << "Error opening db\n";
}

>>It doesn't really open a new window consisted of my db, does it?
No, that has nothing to do with windows. If you want a new window then you will have to create it yourself. google for win32 api tutorials.

2) I don't know what sqlite.exe is. See this short tutorial I wrote. Beyond that, you should probably join their forums to ask tech questions about sqlite.

thanx for the help :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.