Helloword VC6 of database encapsulation class CppSQLite3

Source: Internet
Author: User

Although yesterday spent a day to fix the C interface of SQLite, think today should be able to fix CppSQLite3, but bug this thing ... Really bad to say, has been tossing to 5:30 P.M., during a period of time very irritable, even words do not want to say, inexplicable bug, obviously look no problem. Finally came out, the process is slightly, briefly record the next step, convenient for later use.

Cppsqlite3u is a well-encapsulated class that MFC can use to manipulate sqlite3.

Note: You need to pre-press SQLite and configure your environment.

1.5 Required Documents:

CppSQLite3U.cpp

CppSQLite3U.h

Sqlite3.h

Sqlite3.lib

Sqlite3.dll

: http://download.csdn.net/detail/stan1989/5071045

Add Sqlite3.lib to Object/library, Link, Settings, 2.Project

3. Add CppSQLite3.h and CppSQLite3.cpp to the project

4. Add # include "CppSQLite3U.h" to the program

5. Use

http://blog.csdn.net/stan1989/article/details/8589293

#include <stdio.h>
#include <stdlib.h>
#include "CppSQLite3.h"

int main ()
{
CPPSQLITE3DB DB;
Remove ("test.db");
Db.open ("test.db");
DB.EXECDML ("CREATE TABLE people (ID int,name char[200],age int);");
DB.EXECDML ("INSERT into people values (1, ' WTL ', 24);");
DB.EXECDML ("INSERT into people values (2, ' zbh ', 23)");
Cppsqlite3query query = Db.execquery ("Select * from people");
while (!query.eof ())
{
printf ("id:%s name:%s age:%s\n", Query.getstringfield ("id"),
Query.getstringfield ("name"),
Query.getstringfield ("Age"));
Query.nextrow ();
}
Query.finalize ();
Db.close ();
return 0;
}

You can use the other tutorials for more detailed reference.

Helloword VC6 of database encapsulation class CppSQLite3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.