易截截图软件、单文件、免安装、纯绿色、仅160KB

一个关于SQLite小程序 ,请大家多多指教!

package com.jiao.sqlite;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class DbDemo extends Activity {
 /**
  * SQLite Demo
  *
  * 供Activity私有访问的数据库 没有使用ContentProvider 方式 增加 查询数据
  *
  * @author daguangspecial@gmail.com
  *
  */
  EditText inputTxt;
  Button btnAdd;
  Button btnViewAll;
  TextView viewAll;
  DBHelper db;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   this.setContentView(R.layout.main);
   // 初始化UI
   btnAdd = (Button) findViewById(R.id.btnAdd);
   btnViewAll = (Button) findViewById(R.id.btnViewAll);
   viewAll = (TextView) findViewById(R.id.viewAll);
   inputTxt = (EditText) findViewById(R.id.txtInput);
   // 初始化DB
   db = new DBHelper(this);
   // 初始化监听
   OnClickListener listener = new OnClickListener() {
    public void onClick(View v) {
     if (v.getId() == R.id.btnAdd) {
      // 增加
      boolean flat=db.save(inputTxt.getText().toString());
                                      
        


相关文档:

SQLITE SQL语句的注意


1 TOP
这是一个大家经常问到的问题,例如在SQLSERVER中可以使用如下语句来取得记录集中的前十条记录:
SELECT TOP 10 * from [index] ORDER BY indexid DESC;
但是这条SQL语句在SQLite中是无法执行的,应该改为:
SELECT * from [index] ORDER BY indexid DESC limit 0,10;
其中limit 0,10表示从第0条记录开始,往后 ......

SQLite下载与安装

SQLite
的最新版本可以从这里下载
。下面我们以Windows版本sqlite-3_5_1.zip
为例介绍其安装方法。
(大家可以选择下载安装适合自己的版本)
下载后,将sqlite-3_5_1.zip解压缩至C:\sqlite目录即完成安装。
C:\sqlite目录构造为:
C:\sqlite
  |
  +--sqlite3.exe
打开一个CMD命令窗口
C:\ ......

AutoIt3开发的操作SQlite数据库的源码

AutoIt3开发的操作SQlite数据库的源码下载
部分源码
_SQLite_Startup () ;加载 SQLite.dll
If Not FileExists($SQLite_Data_Path) Then
    SQLCreate()
EndIf
$GUI_Form = GUICreate($Title, 300, 435, -1, -1)
GUISetBkColor(0xECE9D8)  ; will change background color
$GUI_ListBox = GUIC ......

完整的VC下SQLite的使用


文章分类:数据库



SQLite在VC下的使用(转)http://www.sqlite.com.cn/MySqlite/4/523.Html
一、SQLite简介
   SQLite
是用C语言编写的开源数据库,主要用于嵌入式,你也可以把它集成在自己的桌面程序中,也有人将其替代Access,用作后台数据库。
SQLite 支持多数SQL92 ......

sqlite触发器一例

int column_names_printed = 0;
void print_row(int n_values, char** values)
{
    int i;
    for (i = 0; i < n_values; ++i) {
        printf("%10s", values[i]);
    }
    printf("\n& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号