• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • SQLITE數據庫 

    發表于:2013-04-22來源:Csdn作者:FreeBeer點擊數: 標簽:SQLServer
    [cpp] view plaincopyprint? QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");

      [cpp] view plaincopyprint?

      QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");

      db.setDatabaseName("support");

      if(!db.open())

      {

      QMessageBox::critical(0, qApp->tr("Cannot open database"),

      qApp->tr("Unable to establish a database connection.\n"

      "This example needs SQLite support. Please read "

      "the Qt SQL driver documentation for information how "

      "to build it.\n\n"

      "Click Cancel to exit."), QMessageBox::Cancel);

      return false;

      }

      QSqlQuery q;

      q.exec("create table student(id integer primary key,name varchar,age integer)");

      q.exec("insert into student(id,name,age) values(1001,'AnPan',21)");

      q.exec("insert into student(id,name,age) values(1002,'CaoLL',22)");

      return true;

      QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");

      db.setDatabaseName("support");

      if(!db.open())

      {

      QMessageBox::critical(0, qApp->tr("Cannot open database"),

      qApp->tr("Unable to establish a database connection.\n"

      "This example needs SQLite support. Please read "

      "the Qt SQL driver documentation for information how "

      "to build it.\n\n"

      "Click Cancel to exit."), QMessageBox::Cancel);

      return false;

      }

      QSqlQuery q;

      q.exec("create table student(id integer primary key,name varchar,age integer)");

      q.exec("insert into student(id,name,age) values(1001,'AnPan',21)");

      q.exec("insert into student(id,name,age) values(1002,'CaoLL',22)");

      return true;

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>