Sqlite判断字段存在
判断表存在的方法很简单,网上很多:
SELECT COUNT(*) from sqlite_master where type='table' and name='%s'" % tname;
那么判断字段是否存在, 或者说如何判断表的版本是否最新就只需要:
select * from sqlite_master where tbl_name='tblContactList';
sqlite_master 的表结构如下:
type |name |tbl_name |rootpage |sql
最后一个sql就是创建tblContactList表的sql语句, 所以只要判断这个sql语句是否和你的创建语句一样就可以知道该表是不是你最新的版本.
相关文档:
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 ......
文章分类:数据库
SQLite在VC下的使用(转)http://www.sqlite.com.cn/MySqlite/4/523.Html
一、SQLite简介
SQLite
是用C语言编写的开源数据库,主要用于嵌入式,你也可以把它集成在自己的桌面程序中,也有人将其替代Access,用作后台数据库。
SQLite 支持多数SQL92 ......
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.widg ......
1. 下载最新版 SQLite (sqlite-3_6_23_1), copy到C:\下.
2. 新建数据库:
C:\>sqlite3.exe "d:\testdb.db"
3.进入了sqlite3之后,会看到以下文字:
SQLite version 3.1.3
Enter ".help" for instructions
sqlite>
4.建一个名叫film的数据库表
create table film(title, length, year, starring);
5.插入记录 ......
sqlite是
一个非常小巧的跨平台嵌入式数据库,它本身不提供加密功能,不过设计者明显也考虑了加密的方案,我们在源码中可以找到两个预留的加密接
口:sqlite3_key和sqlite3_rekey,可以通过实现这两个接口来达到加密的目的。
如何加密,已经有很多文章描述,可以参考:《
......