ÍêÕûµÄVCÏÂSQLiteµÄʹÓÃ
ÎÄÕ·ÖÀà:Êý¾Ý¿â
SQLiteÔÚVCϵÄʹÓã¨×ª£©http://www.sqlite.com.cn/MySqlite/4/523.Html
Ò»¡¢SQLite¼ò½é
SQLite
ÊÇÓÃCÓïÑÔ±àдµÄ¿ªÔ´Êý¾Ý¿â£¬Ö÷ÒªÓÃÓÚǶÈëʽ£¬ÄãÒ²¿ÉÒÔ°ÑËü¼¯³ÉÔÚ×Ô¼ºµÄ×ÀÃæ³ÌÐòÖУ¬Ò²ÓÐÈ˽«ÆäÌæ´úAccess£¬ÓÃ×÷ºǫ́Êý¾Ý¿â¡£
SQLite Ö§³Ö¶àÊýSQL92±ê×¼£¬ÀýÈ磺Ë÷Òý¡¢ÏÞÖÆ¡¢´¥·¢ºÍ²é¿´Ö§³Ö¡£
Ö§³Ö NULL¡¢INTEGER¡¢REAL¡¢TEXT ºÍ BLOB Êý¾ÝÀàÐÍ£¬Ö§³ÖÊÂÎñ¡£
¶þ¡¢ÏÂÔØSQLite
SQLite¿ÉÒÔµ½¹Ù·½Õ¾µãÏÂÔØ
http://www.sqlite.org/download.html
°üÀ¨£ºLinux,Mac OS X, WindowsϵÄÒѱàÒëÎļþÒÔ¼°Ô´´úÂë¡¢°ïÖúÎĵµ¡£
VCÖÐʹÓÃsqlite
SQLite¹Ù·½ÏÂÔØÖ»Ìṩ¸øÎÒÃÇÒ»¸ösqlite3.dll¸úÒ»¸ösqlite3.defÎļþ£¬²¢Ã»ÓÐÌṩÓÃÓÚVC++6.0µÄlibÎļþ£¬¿ÉÒÔÀûÓÃ
sqlite3.defÎļþÉú³É£¬²½ÖèÈçÏ£º
1.½«sqlite3.h£¨D:\sqlite-amalgamation-3_6_23.zip£©¿½±´µ½C:\Program
Files\Microsoft Visual Studio\VC98\IncludeĿ¼Ï£¬Õâʱ±àÒë¿Éͨ¹ý£¬µ«Á´½Ó´íÎó£¬ÒòΪûÓÐLIBÎļþ£¨£©
2.Æô¶¯Ò»¸öÃüÁîÐгÌÐò£¬½øÈëVCµÄ°²×°Ä¿Â¼C:\Program Files\Microsoft Visual
Studio\VC98\Bin£¬ÔÚÕâ¸öĿ¼ÏÂÃæÓÐÒ»¸öLIB.exeÎļþ£¬Ê¹ÓÃËü¾ÍÄÜÉú³Ésqlite3.libÎļþ£¬½«sqlite3.defÎļþ·Å
µ½ÏàͬĿ¼£¬»òÕß¾ø¶Ô·¾¶Ò²¿ÉÒÔ£¬ È»ºóÔÚÃüÁîÐÐÊäÈëÈçÏÂÃüÁ
LIB /MACHINE:IX86 /DEF:sqlite3.def
¸ÃÃüÁîÉú³ÉÁ½¸öÎļþ£ºsqlite3.libºÍsqlite3.exp
ÔËÐиÃÃüÁîʱ£¬Èç¹ûÌáʾÕÒ²»µ½MSPDB60.DLLÎļþ£¬¿É´ÓÆäËüĿ¼¿½±´ÖÁBinĿ¼ÏÂ
3.½«Éú³ÉµÄsqlite3.lib¿½±´µ½LibĿ¼ÏÂ,½«sqlite3.dll¿½±´µ½C:\WINNT\system32Ŀ¼ÏÂ
4.½«sqlite3.lib¼ÓÈëµ½¹¤³ÌÁ´½ÓÖУ¬Project->Settings,LinkÑ¡Ï£¬Object/library
modules×îºóÌíÈësqlite3.lib
D:\sqlitedll-3_6_23ÀïÓÐ.dllºÍ.defÎļþ
Éú³ÉµÄlibÔÚbinÏÂ
ÕâʱÒÔϳÌÐò±ã¿Éͨ¹ýVC±àÒëÁ´½Ó²¢ÔËÐУº
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
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]);
&nbs
Ïà¹ØÎĵµ£º
SQLiteÓô¥·¢Æ÷À´Ìæ´úÍâ¼üÔ¼Êø CREATE TABLE [Category] (
[Pkid] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
[CategoryName] NVARCHAR(32) NOT NULL,
[CategoryGuid] char(36) UNIQUE NOT NULL,
[CategoryDesc] nvarchar(256) NULL
) C ......
@ǶÈëʽ¹ØϵÐÍÊý¾Ý¿âSQLite
Ìصã
1.Ö§³ÖÎåÖÖÊý¾ÝÀàÐÍ null,INTEGER,REAL(¸¡µãÊý),TEXT(×Ö·û´®Îı¾)ºÍBLOB£¨¶þ½øÖÆÎı¾£©Êý¾ÝÀàÐÍ£¬ËäÈ»
ËüÖ»ÓÐÎåÖÖ£¬µ«Êµ¼ÊÉÏsqlite3Ò²½ÓÊÖvarcher(n),char(n),decimal(p,s)µÈÊý¾ÝÀàÐÍ£ ......
SQLite¹Ù·½ÍøÕ¾Àý×Ó£º
#include <stdio.h>
#include <sqlite3.h>
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
i ......
ÔÚSQLite on BlackBerryÉÏ£¬JDBC·ÃÎÊÊý¾Ý¿â£¬È±Ê¡ÊÇÒÔUTF-8±£´æÊý¾Ýµ½Êý¾Ý¿âÀïÃæµÄ£¬Ã¿¸öÖÐÎÄͨ³£ÊÇ3¸ö×Ö½Ú±£´æµ½Êý¾Ý¿âÉÏÃæµÄ¡£
Àý×Ó´úÂë²Î¿¼£º
BlackBerry sample - SQLiteDemo¡£
×¢Ò⣺ÔÚ²åÈëÖÐÎĵÄʱºò£¬ÇëʹÓÃStatement.bindÖ¸ÁÔÚÎҵIJâÊÔÖУ¬¿ÉÒԺܺõı£´æÖÐÎÄÊý¾Ý¡£¶ÁÈ¡µÄʱºòÖ»ÐèҪʹÓÃResult ......
QT¶ÁдSqliteÊý¾Ý¿â
//.h
/****************************************************************************
**
** Date : 2010-05-08
** Author : furtherchan
** If you have any questions , please contact me
**
****************************************************************** ......