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

Å×ÆúMS Access°É£¬ÇëʹÓÃSQLite

Å×ÆúMS Access°É£¬ÇëʹÓÃSQLite
1¡¢SQLite¼ò½é
SQLiteµÚÒ»¸öAlpha°æ±¾µ®ÉúÓÚ2000Äê5ÔÂ. ÖÁ½ñÒѾ­ÓÐ4¸öÄêÍ·ÁË. ¶øÔÚ½ñÄêµÄ5ÔÂSQLiteÒ²Ó­À´ÁËÒ»¸öеÄÀï³Ì: SQLite 3. SQLite¹Ù·½ÍøÕ¾: http://www.sqlite.org/
2¡¢SQLiteÀàÐÍ
SQLiteµÄÊý¾ÝÀàÐÍ
Ê×ÏÈÄã»á½Ó´¥µ½Ò»¸öÈÃÄ㾪ÑȵÄÃû´Ê: Typelessness(ÎÞÀàÐÍ). ¶Ô! SQLiteÊÇÎÞÀàÐ͵Ä. ÕâÒâζ×ÅÄã¿ÉÒÔ±£´æÈκÎÀàÐ͵ÄÊý¾Ýµ½ÄãËùÏëÒª±£´æµÄÈκαíµÄÈκÎÁÐÖÐ, ÎÞÂÛÕâÁÐÉùÃ÷µÄÊý¾ÝÀàÐÍÊÇʲô(Ö»ÓÐÔÚÒ»ÖÖÇé¿öϲ»ÊÇ, ÉÔºó½âÊÍ). ¶ÔÓÚSQLiteÀ´Ëµ¶Ô×ֶβ»Ö¸¶¨ÀàÐÍÊÇÍêÈ«ÓÐЧµÄ. Èç:
Create Table ex1(a, b, c);
³ÏÈ»SQLiteÔÊÐíºöÂÔÊý¾ÝÀàÐÍ, µ«ÊÇÈÔÈ»½¨ÒéÔÚÄãµÄCreate TableÓï¾äÖÐÖ¸¶¨Êý¾ÝÀàÐÍ. ÒòΪÊý¾ÝÀàÐͶÔÓÚÄãºÍÆäËûµÄ³ÌÐòÔ±½»Á÷, »òÕßÄã×¼±¸»»µôÄãµÄÊý¾Ý¿âÒýÇæ. SQLiteÖ§³Ö³£¼ûµÄÊý¾ÝÀàÐÍ, Èç:
CREATE TABLE ex2(
a VARCHAR(10),
b NVARCHAR(15),
c TEXT,
d INTEGER,
e FLOAT,
f BOOLEAN,
g CLOB,
h BLOB,
i TIMESTAMP,
j NUMERIC(10,5)
k VARYING CHARACTER (24),
l NATIONAL VARYING CHARACTER(16)
);
Ç°ÃæÌáµ½ÔÚijÖÖÇé¿öÏÂ, SQLiteµÄ×ֶβ¢²»ÊÇÎÞÀàÐ͵Ä. ¼´ÔÚ×Ö¶ÎÀàÐÍΪ”Integer Primary Key”ʱ.
SQLiteÖ§³ÖSQL92 ±ê×¼¡£
3¡¢ÓÃ.NET²Ù×÷sqliteÊý¾Ý¿â
System.Data.SQLite
ÊÇÒ»¸öԭʼSQLiteµÄ¼ÓÇ¿°æ.  Ëü½«ÊÇÒ»¸öÔ­°æµÄsqlite3.dllÍêÈ«Ìæ´úÆ· (ÄãÉõÖÁ¾Í¿ÉÒÔ°ÑËüÖØÃüÃûΪsqlite3.dll).  Ëü²»ÐèÒªÁ´½Ó.NET ÔËÐÐʱ£¬ËùÒÔ¿ÉÒÔÍÑÀë.NET¶ÀÁ¢·¢²¼, È»¶øËüÄÚǶÁËÒ»¸öÍêÕûµÄ ADO.NET 2.0 ÒýÇ棬Ϊ¿ª·¢ÌṩÁËÍêÕûµÄÖ§³Ö.
ÒÔÏÂÊÇËüµÄÌØÐÔ¼ò½é:
ÍêÕûµÄ ADO.NET 2.0 ʵÏÖ
Õû¸ö¹¤³ÌÍêÈ«»ùÓÚVS2005 ºÍ ADO.NET 2.0ȫй¹½¨, ʹÓÃÁËÈ«²¿µÄADO.NET frameworkÐÂÌØÐÔ.  °üÀ¨ÍêÕûµÄ DbProviderFactory Ö§³Ö, ×Ô¶¯µÄ·Ö²¼Ê½ÊÂÎñµ÷ÓÃ, ¹ã·ºµÄģʽ֧³Ö, ´ËÍâËùÓеÄÀ඼ÊÇ´Ó ADO.NET 2.0 µÄ»ùÀà¼Ì³ÐÏÂÀ´µÄ.
Ö§³ÖÍêÕûºÍ¾«¼òµÄ .NET Framework ÒÔ¼° C/C++
Õâ¸ö¿â²»ÐèÒªÁ´½ÓÒÀÀµ.NETÔËÐÐʱ£¬100%¼æÈÝԭʼµÄsqlite3.dll£¬¿ÉÒÔʹÓ÷ÇÍйܵÄC/C++ ½øÐпª·¢.
¿ÉÒÆÖ²µÄÊý¾Ý¿âÎļþ
δ¼ÓÃÜµÄ SQLite Êý¾Ý¿âÎļþ¿ÉÒÔ×ÔÓɵĿçƽ̨ºÍ´¦ÀíÆ÷ʹÓ㬰üÀ¨·ÇWindowsƽ̨. ¼ÓÃÜÖ®ºóµÄÊý¾Ý¿â¿ÉÒÔÔÚÈ«²¿Windowsƽ̨ÉÏʹÓÃ.
¿ÉÒÔÐÅÀµµÄËٶȣ¬±È°üÀ¨Sql Server Mobile ÔÚÄÚµÄÆäËü´ó¶àÊýǶÈëʽÊý¾Ý¿â¶¼Òª¿ìËÙ
SQLite'°²×°ËùÕ¼ÓõĿռäÏà¶ÔÓÚSql Mobile¿ÉνºöÂÔ²»¼ÆÁË. ËüÔ


Ïà¹ØÎĵµ£º

SQL Access´´½¨±í

Ò»¡¢´´½¨Ò»ÕÅ¿Õ±í£º
Sql="Create TABLE [±íÃû]"
¶þ¡¢´´½¨Ò»ÕÅÓÐ×Ö¶ÎµÄ±í£º
Sql="Create TABLE [±íÃû]([×Ö¶ÎÃû1] MEMO NOT NULL, [×Ö¶ÎÃû2] MEMO, [×Ö¶ÎÃû3] COUNTER NOT NULL, [×Ö¶ÎÃû4] DATETIME, [×Ö¶ÎÃû5] TEXT(200), [×Ö¶ÎÃû6] TEXT(200))
×Ö¶ÎÀàÐÍ£º
2 : "SmallInt", // ÕûÐÍ
3 : "Int", ......

Access ´íÁË£¬»¹ÊÇÎÒɵÁË

×î½üϵͳÔËÐÐÖз¢ÏÖAccess 2003 °æ±¾ÖжԴý Null ºÍ ‘’ £¨¿Õ×Ö·û£©Ææ¹ÖÎÊÌ⣬ÖØÏÖ²½Ö裺
1¡¢´´½¨±ítabTest £»
2¡¢Ê¹ÓÃÉè¼ÆÊÓͼÌí¼ÓÁ½¸ö×ֶΠID £¬col1
Ãû³Æ
ÀàÐÍ
³¤¶È
˵Ã÷
ID
Number
 
 
Ö÷¼ü£¬×ÔÔö
Col1
char
1
ÎÞ
 
3¡¢Ê¹ÓÃsql Ìí¼ÓÈçÏÂÊý¾Ý
-- col1 ×Ö¶ÎÉèÖÃΪ null
INS ......

ÀûÓà DataGridView »æÖÆͼƬÁÐ±í£¨´ÓAccess¶ÁȡͼƬ£©

using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using Access = Microsoft.Office.Interop.Access;
namespace ImageAccess
{
    static class Program
    {
   ......

ÀûÓà DataGridView »æÖÆͼƬÁÐ±í£¨´ÓAccess¶ÁȡͼƬ£©

using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using Access = Microsoft.Office.Interop.Access;
namespace ImageAccess
{
    static class Program
    {
   ......

ACCESSµÄÄ£ºý²éѯ

ÔÚSQL ServerÖÐÄ£ºý²éѯͨ³£ÊÇÕâÑùµÄSelect * from articleTable where authorName like '%jacky%'
µ«ÊÇÔÚAccessÖÐÓÃÕâÌõÓï¾äÖ´ÐеÄʱºò¾¹È»·¢Ïֲ鲻³ö½á¹û£¬Ôõô¿ÉÄÜÄØ£¿
ºóÀ´²éÁËÏÂ×ÊÁÏ£¬·¢ÏÖÎÊÌâÈçÏ£º
Òª½øÐÐÄ£ºý²éÕÒ£¬Ôò±ØÐëʹÓÃͨÅä·û£¬ACCESS¿âµÄͨÅä·ûºÍSQL SERVERµÄͨÅä·û²»Ò»Ñù¡£
ACCESS¿âµÄͨÅä·ûΪ£º
*& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ