zoukankan      html  css  js  c++  java
  • delphi操作sqlite3

    Delphi SQLite 简明无废话上手指南SQLite下载
    http://www.sqlite.org/download.html

    SQLite FAQ
    http://www.sqlitecn.org/faq.html

    SQLite中文论坛
    http://sqlite.com.cn/bbs/index.asp

    SQLite入门与分析
    http://www.cnblogs.com/hustcat/archive/2009/02/12/1389448.html

    GUI 管理工具
    SQLite Database Browser
    http://sqlitebrowser.sourceforge.net/

    Delphi控件
    ASqlite3 Components
    http://www.aducom.com/cms/download.php

    简明例程:

    数据库连接
    ASQLite3DB1.Database := Path+'test.db';
    ASQLite3DB1.DriverDLL := Path+'sqlite3.dll';
    ASQLite3DB1.Open;

    数据集
    ASQLite3Query1.Connection := ASQLite3DB1;
    ASQLite3Query1.SQL.Text :='select * from MyTable';
    ASQLite3Query1.Open;

    执行SQL
    ASQLite3Query1.Connection := ASQLite3DB1;
    ASQLite3Query1.SQL.Text := Format('insert into MyTable(Age,Name)values(%s,''%s'')',
    [edtAge.Text,edtName.Text]);
    ASQLite3Query1.ExecSQL;
    或者
    ASQLite3DB1.SQLite3_ExecSQL(Format('update MyTable set Age=Age+1',
    [Edit2.Text,Edit1.Text]));
    或者
    with ASQLite3Query2 do begin
    Close;
    SQL.Clear;
    SQL.Add('insert into animal (id, desc) values (:v1, :v2)');
    Params[0].AsString := '99';
    Params[1].AsString := 'ninetynine';
    ExecSQL;
    end;

    事务
    //开始事务
    ASQLite3DB1.StartTransaction;
    //提交事务
    ASQLite3DB1.Commit;
    //回滚事务
    ASQLite3DB1.RollBack;

    http://www.delphixe.net/2017/07/17/delphi-sqlite-%E7%AE%80%E6%98%8E%E4%B8%8A%E6%89%8B%E6%8C%87%E5%8D%97/

  • 相关阅读:
    bzoj3028食物 关于(1+x+x^2+x^3+x^4+...)^k的第i项系数就是c(i+k−1,k−1)的证明
    一个好玩的题--倒水
    HDU4372(第一类斯特林数)
    MySQL常用基本语句
    腾讯windows客户端一面
    腾讯PC客户端开发方向一面
    LeetCode数据库175
    Intern Day47
    Intern Day46
    Intern Day46
  • 原文地址:https://www.cnblogs.com/kekemuyu/p/9905969.html
Copyright © 2011-2022 走看看