Å×Æú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 Prima ......
asp ÖÐÎÄÂÒÂë,asp access ÂÒÂë,asp ˢкóÂÒÂë,asp utf 8ÂÒÂë,ajax ÂÒÂë asp,asp ºº×ÖÂÒÂë,aspÂÒÂëÔõô°ì
ÓÃutf-8±àÂëÓÃÔÚеÄÍøÕ¾ÉÏ£¬²»ÏëÎÊÌ⻹Õæ¶à£¬ËùÒÔÕÒÁËЩÎÄÕ£¬Ìû×Ó£¬¿´ÁË¿´£¬µÈÏÂÓÐÓõľÍÌùÏÂÃæÁË¡£
½ñÌ죬ÎÒ¿ªÊ¼°Ñ CODEPAGE="936" ¸Ä³É CODEPAGE="65001"
°Ñcharset=gb2312¸Ä³É charset=utf-8
¿ÉÊÇ»¹ÊÇÂÒÂ룬ֻҪÊǽű¾Óõĵط½»¹ÊÇÂÒÂ룬ÏÖÔÚÖÕÓÚÕÒµ½ÎÊÌâÁË£¬¾ÍÊǵ±½Å±¾Êä³öʱºò£¬ÒªÒÔutf-8±àÂëÊä³ö¡£
¾ÍÊÇÒª¼ÓÒ»¾ä<% Response.Charset = "utf-8" %>
¢ÙÊ×Ïȵ±È»ÊÇÒ³Ãæ±¾ÉíÓÃutf-8±àÂ룬ÔÚDWн¨Ò³Ê±Ä¬ÈϱàÂ붨Ϊ“Unicode(UTF-8)”
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
' ¢ÚCODEPAGE="65001" ¸æËß·þÎñÆ÷Ò³ÃæʹÓÃUTF-8±àÂëµÄ
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
' ¢Ûcharset=utf-8¸æËßä¯ÀÀÆ÷Ò³ÃæʹÓÃUTF-8±àÂëµÄ
</head>
<body>
<% Response.Charset = "utf-8" %>
' ¢Ü·þÎñÆ÷Êä³ö±àÂëΪutf-8
</body>
</html>
ˢкóÓÖ±ä³ÉÂÒÂ룬»òÕßä¯ÀÀÆäËûµÄgb2312µÄÒ³Ãæ»ØÀ´ÓÖÂÒÂëÁË¡£ÖµµÃÓÖÈ¥googleÁËһϣ¬ºÇºÇ£¬»¹ÊÇÕ ......
asp ÖÐÎÄÂÒÂë,asp access ÂÒÂë,asp ˢкóÂÒÂë,asp utf 8ÂÒÂë,ajax ÂÒÂë asp,asp ºº×ÖÂÒÂë,aspÂÒÂëÔõô°ì
ÓÃutf-8±àÂëÓÃÔÚеÄÍøÕ¾ÉÏ£¬²»ÏëÎÊÌ⻹Õæ¶à£¬ËùÒÔÕÒÁËЩÎÄÕ£¬Ìû×Ó£¬¿´ÁË¿´£¬µÈÏÂÓÐÓõľÍÌùÏÂÃæÁË¡£
½ñÌ죬ÎÒ¿ªÊ¼°Ñ CODEPAGE="936" ¸Ä³É CODEPAGE="65001"
°Ñcharset=gb2312¸Ä³É charset=utf-8
¿ÉÊÇ»¹ÊÇÂÒÂ룬ֻҪÊǽű¾Óõĵط½»¹ÊÇÂÒÂ룬ÏÖÔÚÖÕÓÚÕÒµ½ÎÊÌâÁË£¬¾ÍÊǵ±½Å±¾Êä³öʱºò£¬ÒªÒÔutf-8±àÂëÊä³ö¡£
¾ÍÊÇÒª¼ÓÒ»¾ä<% Response.Charset = "utf-8" %>
¢ÙÊ×Ïȵ±È»ÊÇÒ³Ãæ±¾ÉíÓÃutf-8±àÂ룬ÔÚDWн¨Ò³Ê±Ä¬ÈϱàÂ붨Ϊ“Unicode(UTF-8)”
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
' ¢ÚCODEPAGE="65001" ¸æËß·þÎñÆ÷Ò³ÃæʹÓÃUTF-8±àÂëµÄ
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
' ¢Ûcharset=utf-8¸æËßä¯ÀÀÆ÷Ò³ÃæʹÓÃUTF-8±àÂëµÄ
</head>
<body>
<% Response.Charset = "utf-8" %>
' ¢Ü·þÎñÆ÷Êä³ö±àÂëΪutf-8
</body>
</html>
ˢкóÓÖ±ä³ÉÂÒÂ룬»òÕßä¯ÀÀÆäËûµÄgb2312µÄÒ³Ãæ»ØÀ´ÓÖÂÒÂëÁË¡£ÖµµÃÓÖÈ¥googleÁËһϣ¬ºÇºÇ£¬»¹ÊÇÕ ......
1:ÔÚStaAfx.h ÖÐÌí¼ÓÈçÏ´úÂë #import "C:\\Program Files\\Common Files \\System\\ado\\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
2:ÔÚBOOL CXXXApp::InitInstance()Öгõʼ»¯COM»·¾³
::CoInitialize(NULL);
ÊÍ·ÅCOM»·¾³
::CoUninitialize();
3£ºÔÚCXXXAppÍ·ÎļþÖж¨ÒåÁ½¸öÖÇÄÜÖ¸Õëpublic
Ö¸ÏòRecordset¶ÔÏóµÄÖ¸Õë
_RecordsetPtr m_pRecordset;
Ö¸ÏòConnection¶ÔÏóµÄÖ¸Õë
_ConnectionPtr m_pConnection;
4:ÔÚvoid CXXXApp::OnInitADOConn()
{
//ÓÃÓÚÈ«¾Ö±äÁ¿µ÷ÓÃÁ¬½ÓÊý¾Ý¿â
try
{
//´´½¨Á¬½Ó¶ÔÏóʵÀý
m_pConnection.CreateInstance("ADODB.Connection");
//ÉèÖÃÁ¬½Ó×Ö·û´®
CString strConnect="DRIVER={Microsoft Access Driver/ & ......
1:ÔÚStaAfx.h ÖÐÌí¼ÓÈçÏ´úÂë #import "C:\\Program Files\\Common Files \\System\\ado\\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
2:ÔÚBOOL CXXXApp::InitInstance()Öгõʼ»¯COM»·¾³
::CoInitialize(NULL);
ÊÍ·ÅCOM»·¾³
::CoUninitialize();
3£ºÔÚCXXXAppÍ·ÎļþÖж¨ÒåÁ½¸öÖÇÄÜÖ¸Õëpublic
Ö¸ÏòRecordset¶ÔÏóµÄÖ¸Õë
_RecordsetPtr m_pRecordset;
Ö¸ÏòConnection¶ÔÏóµÄÖ¸Õë
_ConnectionPtr m_pConnection;
4:ÔÚvoid CXXXApp::OnInitADOConn()
{
//ÓÃÓÚÈ«¾Ö±äÁ¿µ÷ÓÃÁ¬½ÓÊý¾Ý¿â
try
{
//´´½¨Á¬½Ó¶ÔÏóʵÀý
m_pConnection.CreateInstance("ADODB.Connection");
//ÉèÖÃÁ¬½Ó×Ö·û´®
CString strConnect="DRIVER={Microsoft Access Driver/ & ......
Ç°¼¸ÌìΪÖÆ×÷Ò»¸öÍøÕ¾£¬ÐèÒª´ÓACCESSתÖÁSQLSERVER£¬´ÓÍøÕ¾Éϲ鿴Á˺ܶàµÄ×ÊÁÏ£¬µ«¾õµÃûÓÐÒ»¸öÄܹ»È«Ã渲¸ÇÒªµãµÄ£¬ËùÒÔÎÒ×ܽáһϣ¬Ë³±ã
¸ø³öһЩ¾Ñé¡£
Ê×ÏÈÈç¹ûÒ»¿ªÊ¼¾ÍÐèÒªÖÆ×÷SQLSERVERµÄÍøÕ¾£¬ÄÇô×îºÃ½«ÄãµÄ°®»ú×°ÉÏWINDOWS2000»òÕß2003ÕâÑùµÄSERVER°æ£¬ÕâÑùµÄ°æ±¾ÊÇÖ§³Ö
SQLSERVERÕýʽ°æµÄ°²×°µÄ£¬¶øXPÖ»ÄÜÖ§³Ö¸öÈË°æ»òÕß¿ª·¢°æ£¬ÎÒûÓÐ×°¹ý£¬µ«¶ÔÓÚµ÷ÊÔÍøÕ¾¶øÑÔ×îºÃ»¹ÊÇÔÚÕýʽ°æϹ¤×÷£¬×ª»¯µÄÕû¸ö¹ý³Ì²»ËãÌ«¸´
ÔÓ£¬µ«ÖÁÉÙ¿ÉÒÔÊ¡ÏÂһЩ¾«Á¦¡£Îҵİ®»úÊÇXP£¬ËùÒÔÖ»ºÃÏÈÓÃACCESSµ÷ÊÔ¡£
ºÃÁË£¬µ±ÄãÕÒµ½Ò»Ì¨×°ÓÐSQLSERVERµÄ»úÆ÷ʱ£¬Äã±ã¿ÉÒÔ¿ªÊ¼×ª»»²¢µ÷ÊÔÁË¡£
1¡£ÏÈÀûÓÃת»¯Èí¼þ£ºCooSel2.0 CreateSQL
V1.05£¬ÎÒÓõÄÕâ¸ö£¬·Ç³£ºÃÓ᣾ßÌå²Ù×÷µÄ»°£¬ÎÒÓõÄÊÇÉú³ÉÉýǨSQL½Å±¾£¬±£´æΪ
*.sqlÎļþºó£¬ÔÚSQL2000µÄ²éѯ·ÖÎöÆ÷Àïµ÷ÈëÖ´ÐС£¶øSQLSERVERµÄ¾ßÌå²Ù×÷Ôڴ˲»±ã׸Êö¡£ÕâÑù£¬ÄãµÄÊý¾Ý¿â¾Íת»¯³ÉÁËMSSQLÊý¾Ý¿â
2¡£¶Ôasp¶øÑÔ£¬Ê×ÏÈÊÇÊý¾Ý¿âÁ¬½ÓÎļþµÄÐ޸ģºÕâµã¿ÉÒԲο¼¶¯ÍøÂÛ̳µÄconn.asp
Dim ConnStr
'sqlÊý¾Ý¿âÁ¬½Ó²ÎÊý£ºÊý¾Ý¿âÃû¡¢Óû§ÃÜÂë¡¢Óû§Ãû¡¢Á¬½ÓÃû£¨±¾µØÓ ......
Ç°¼¸ÌìΪÖÆ×÷Ò»¸öÍøÕ¾£¬ÐèÒª´ÓACCESSתÖÁSQLSERVER£¬´ÓÍøÕ¾Éϲ鿴Á˺ܶàµÄ×ÊÁÏ£¬µ«¾õµÃûÓÐÒ»¸öÄܹ»È«Ã渲¸ÇÒªµãµÄ£¬ËùÒÔÎÒ×ܽáһϣ¬Ë³±ã
¸ø³öһЩ¾Ñé¡£
Ê×ÏÈÈç¹ûÒ»¿ªÊ¼¾ÍÐèÒªÖÆ×÷SQLSERVERµÄÍøÕ¾£¬ÄÇô×îºÃ½«ÄãµÄ°®»ú×°ÉÏWINDOWS2000»òÕß2003ÕâÑùµÄSERVER°æ£¬ÕâÑùµÄ°æ±¾ÊÇÖ§³Ö
SQLSERVERÕýʽ°æµÄ°²×°µÄ£¬¶øXPÖ»ÄÜÖ§³Ö¸öÈË°æ»òÕß¿ª·¢°æ£¬ÎÒûÓÐ×°¹ý£¬µ«¶ÔÓÚµ÷ÊÔÍøÕ¾¶øÑÔ×îºÃ»¹ÊÇÔÚÕýʽ°æϹ¤×÷£¬×ª»¯µÄÕû¸ö¹ý³Ì²»ËãÌ«¸´
ÔÓ£¬µ«ÖÁÉÙ¿ÉÒÔÊ¡ÏÂһЩ¾«Á¦¡£Îҵİ®»úÊÇXP£¬ËùÒÔÖ»ºÃÏÈÓÃACCESSµ÷ÊÔ¡£
ºÃÁË£¬µ±ÄãÕÒµ½Ò»Ì¨×°ÓÐSQLSERVERµÄ»úÆ÷ʱ£¬Äã±ã¿ÉÒÔ¿ªÊ¼×ª»»²¢µ÷ÊÔÁË¡£
1¡£ÏÈÀûÓÃת»¯Èí¼þ£ºCooSel2.0 CreateSQL
V1.05£¬ÎÒÓõÄÕâ¸ö£¬·Ç³£ºÃÓ᣾ßÌå²Ù×÷µÄ»°£¬ÎÒÓõÄÊÇÉú³ÉÉýǨSQL½Å±¾£¬±£´æΪ
*.sqlÎļþºó£¬ÔÚSQL2000µÄ²éѯ·ÖÎöÆ÷Àïµ÷ÈëÖ´ÐС£¶øSQLSERVERµÄ¾ßÌå²Ù×÷Ôڴ˲»±ã׸Êö¡£ÕâÑù£¬ÄãµÄÊý¾Ý¿â¾Íת»¯³ÉÁËMSSQLÊý¾Ý¿â
2¡£¶Ôasp¶øÑÔ£¬Ê×ÏÈÊÇÊý¾Ý¿âÁ¬½ÓÎļþµÄÐ޸ģºÕâµã¿ÉÒԲο¼¶¯ÍøÂÛ̳µÄconn.asp
Dim ConnStr
'sqlÊý¾Ý¿âÁ¬½Ó²ÎÊý£ºÊý¾Ý¿âÃû¡¢Óû§ÃÜÂë¡¢Óû§Ãû¡¢Á¬½ÓÃû£¨±¾µØÓ ......
*
* ¹¦ÄÜ˵Ã÷:±¸·ÝºÍ»Ö¸´SQL ServerÊý¾Ý¿â
* ×÷Õß: Áõ¹¦Ñ«;
* °æ±¾:V0.1(C#2.0);ʱ¼ä:2007-1-1
* µ±Ê¹ÓÃSQL Serverʱ,ÇëÒýÓà COM×é¼þÖеÄ,SQLDMO.dll×é¼þ
* µ±Ê¹ÓÃAccessÖÐ,Çëä¯ÀÀÌí¼ÓÒýÓÃÒÔÏÂÁ½¸ödll
* ÒýÓÃC:/Program Files/Common Files/System/ado/msadox.dll,¸ÃDLL°üº¬ADOXÃüÃû¿Õ¼ä
* ÒýÓÃC:/Program Files/Common Files/System/ado/msjro.dll,¸ÃDLL°üº¬JROÃüÃû¿Õ¼ä
* *******************************************************************************/
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using ADOX;//¸ÃÃüÃû¿Õ¼ä°üº¬´´½¨ACCESSµÄÀà(·½·¨)--½â¾ö·½°¸ ==> ÒýÓà ==> Ìí¼ÓÒýÓà ==> ÓÎÀÀÕÒµ½.dll
using JRO;//¸ÃÃüÃû¿Õ¼ä°üº¬Ñ¹ËõACCES ......
*
* ¹¦ÄÜ˵Ã÷:±¸·ÝºÍ»Ö¸´SQL ServerÊý¾Ý¿â
* ×÷Õß: Áõ¹¦Ñ«;
* °æ±¾:V0.1(C#2.0);ʱ¼ä:2007-1-1
* µ±Ê¹ÓÃSQL Serverʱ,ÇëÒýÓà COM×é¼þÖеÄ,SQLDMO.dll×é¼þ
* µ±Ê¹ÓÃAccessÖÐ,Çëä¯ÀÀÌí¼ÓÒýÓÃÒÔÏÂÁ½¸ödll
* ÒýÓÃC:/Program Files/Common Files/System/ado/msadox.dll,¸ÃDLL°üº¬ADOXÃüÃû¿Õ¼ä
* ÒýÓÃC:/Program Files/Common Files/System/ado/msjro.dll,¸ÃDLL°üº¬JROÃüÃû¿Õ¼ä
* *******************************************************************************/
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using ADOX;//¸ÃÃüÃû¿Õ¼ä°üº¬´´½¨ACCESSµÄÀà(·½·¨)--½â¾ö·½°¸ ==> ÒýÓà ==> Ìí¼ÓÒýÓà ==> ÓÎÀÀÕÒµ½.dll
using JRO;//¸ÃÃüÃû¿Õ¼ä°üº¬Ñ¹ËõACCES ......
Access ¹æ¸ñ
Microsoft Access Êý¾Ý¿â¹æ¸ñ
Access Êý¾Ý¿â
ÊôÐÔ×î´óÖµ
Microsoft Access Êý¾Ý¿â (.mdb) Îļþ´óС
2G ×Ö½Ú¼õȥϵͳ¶ÔÏóËùÐèµÄ¿Õ¼ä¡£
Êý¾Ý¿âÖеĶÔÏó¸öÊý
32,768
Ä£¿é£¨°üÀ¨“ÄÚº¬Ä£¿é”ÊôÐÔΪ“ÊÇ”µÄ´°ÌåºÍ±¨±í£©
1,000
¶ÔÏóÃû³ÆÖеÄ×Ö·ûÊý
64
ÃÜÂëµÄ×Ö·û¸öÊý
14
Óû§Ãû»ò×éÃûµÄ×Ö·û¸öÊý
20
²¢·¢Óû§µÄ¸öÊý
255
±í
ÊôÐÔ×î´óÖµ
±íÃûµÄ×Ö·û¸öÊý
64
×Ö¶ÎÃûµÄ×Ö·û¸öÊý
64
±íÖÐ×ֶεĸöÊý
255
´ò¿ª±íµÄ¸öÊý
2048£»Êµ¼Ê¿É´ò¿ªµÄ±íµÄÊýÄ¿¿ÉÄÜ»áÉÙһЩ£¬ÒòΪ Microsoft Access »¹Òª´ò¿ªÒ»Ð©ÄÚ²¿µÄ±í¡£
±íµÄ´óС
2G ×Ö½Ú¼õȥϵͳ¶ÔÏóËùÐèµÄ¿Õ¼ä
“Îı¾”×ֶεÄ×Ö·û¸öÊý
255
“±¸×¢”×ֶεÄ×Ö·û¸öÊý
ͨ¹ýÓû§½çÃæÊäÈëΪ 65,535£»ÒÔ±à³Ì·½Ê½ÊäÈëʱΪ 1G ×Ö½ÚµÄ×Ö·û´æ´¢¡£
“OLE ¶ÔÏó”×ֶεĴóС
1G ×Ö½Ú
±íÖеÄË÷Òý¸öÊý
32
Ë÷ÒýÖеÄ×ֶθöÊý
10
ÓÐЧÐÔÏûÏ¢µÄ×Ö·û¸öÊý
255
ÓÐЧÐÔ¹æÔòµÄ×Ö·û¸öÊý
2,048
±í»ò×Ö¶Î˵Ã÷µÄ×Ö·û¸öÊý
255
¼Ç¼µÄ×Ö·û¸öÊý£¨³ý“±¸×¢”×ֶκ͓OLE ¶ÔÏó”×Ö¶ÎÍ⣩
2,000
×Ö¶ÎÊôÐÔÉèÖõÄ×Ö·û¸öÊý
255
²éѯ
ÊôÐÔ×î´óÖµ
......