Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLiteÓô¥·¢Æ÷À´Ìæ´úÍâ¼üÔ¼Êø

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
) CREATE TABLE [Product] (
  [Pkid] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,
  [CategoryPkid] INTEGER  NOT NULL,
  [ProductName] nvarchar(32)  NULL,
  [ProductPrice] NUMERIC(19,4) DEFAULT '0.00' NOT NULL
)   --InsertÔ¼Êø
CREATE TRIGGER FK_Product_CategoryPkid_Insert
BEFORE Insert ON Product
FOR EACH ROW BEGIN
  SELECT RAISE(ROLLBACK,'No this categoryPkid in category')
  WHERE (SELECT Pkid from Category WHERE Pkid = NEW.CategoryPkid) IS NULL;
END --UpdateÔ¼Êø
CREATE TRIGGER FK_Product_CategoryPkid_Update
BEFORE Update ON Product
FOR EACH ROW BEGIN
  SELECT RAISE(ROLLBACK,'No this categoryPkid in category')
  WHERE (SELECT Pkid from Category WHERE Pkid = NEW.CategoryPkid) IS NULL;
END


Ïà¹ØÎĵµ£º

ASPÁ¬½ÓSQLiteÊý¾Ý¿âÒ»Àý

ÒªÓÃASPÀ´²Ù×÷SQLiteÊý¾Ý¿â£¬Ç°ÌáÌõ¼þÊÇÔÚ·þÎñÆ÷Éϵð²×°SQLiteµÄODBCÇý¶¯³ÌÐò£¬¿Éµ½Õâ¸öÕ¾µãÉÏÏÂÔØ°²×°£ºhttp://www.ch-werner.de/sqliteodbc/£¬°²×°ºÃºó¾Í¿ÉÒÔÏñʹÓÃAccessÒ»ÑùÀ´Ê¹ÓÃSQLiteÁË£¡Ï±ßÊÇÒ»¸öSQLiteÊý¾Ý¿â½á¹¹£º
ÒýÓÃÄÚÈÝ
Create TABLE admin(username text,age integer);
ÎÒÃÇÔÙÀ´ÓÃASPÑÝʾÏÂÈçºÎ¶ÔSQLi ......

2010ÄêSQLiteѧϰ±Ê¼ÇÖ®Ò»


2010ÄêSQLiteѧϰ±Ê¼ÇÖ®Ò»
Ò»£®            ÈçºÎ»ñÈ¡SQLite×îа汾
¹Ù·½Õ¾µã£ºhttp://www.sqlite.org/
´Óhttp://www.sqlite.org/ÍøÕ¾µÄDownloadÒ³Ãæ»ñÈ¡
¼´ÈçÏÂÒ³ÃæÏÂÔØ
http://www.sqlite.org/download.html
¶þ£®WindowsϵÄSQLiteµÄÔ´´úÂëÊÇÄĸöÈí¼þÑ¹Ë ......

sqliteÊý¾Ý¿â»ù±¾²Ù×÷

//²åÈë¼°¸üвÙ×÷
 int nRet = 0;
 sqlite3 * db = NULL;
 CString strFilePath;  //Êý¾Ý¿â´æ´¢Â·¾¶
//·¾¶¸³Öµ£¨Ê¡ÂÔ£©
 //Á¬½ÓÊý¾Ý¿â
 nRet = sqlite3_open16(strFilePath, &db);    //Óм¸¸ö´ò¿ªº¯Êý¿É¹©µ÷Óã¬Ê¹ÓÃWCHARÀàÐÍ·¾¶ÓÃÕâ¸ö
 if(nRet != SQLIT ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ