Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : access

½«AccessµÄÄÚÈÝǨÒƵ½MySQLÊý¾Ý¿â

Ô­±¾µÄÄ¿µÄÊǽ«Êý¾Ý¿â´ÓMS SQL 2000ǨÒƵ½MySQLÖУ¬µ«ÌáʾJDBCÁ¬½Óʧ°Ü£¬ÎÞÄÎÖ®¼«£¬Ö»ºÃÑ¡ÔñÖмäÇÅÁºAccessÍê³ÉÕâÏîÁîÈËÌÖÑáµÄ¹¤×÷ÁË¡£
´ó¸Å²½ÖèÈçÏ£º
1£¬´ÓMS SQL 2000½«Êý¾Ýµ¼³öµ½AccessÖУ¬ÓÐ¹Ø±í¶¨ÒåºÃÖ÷¼üºÍ×Ô¶¯±àºÅ²¿·Ö²»È»Ç¨ÒƺóÓÖµÃÐÞ¸ÄMySQLµÄ±í¡£
2£¬ÐÞ¸ÄAccess±íÖйÜÀíÔ±×é¡¢¹ÜÀíÔ±µÄȨÏÞ£¬±£Ö¤AccessµÄÄÚÖÃϵͳ±íÄÜÕý³£·ÃÎÊ£¬ÏêϸÇë²Î¿¼MySQL Migration Toolkit°ïÖúÖеIJ¿·Ö:Chapter 13. Preparing a Microsoft Access Database for Migration¡£
3£¬´ò¿ªMySQL Migration Toolkit£¬ÉèÖúÃÓйزÎÊý½øÐÐǨÒƲÙ×÷¡£×¢Òâ¿´Çå³þ½çÃæÉϵÄÌáʾ£¬²»Òª°ÑËùÓÐ±í¶¼¼ÓÈëµ½ÒªºöÂԵıíÇåµ¥£¬ÎÒµÚÒ»´Îû¿´¾ÍÈ«·Å½øÈ¥ÁË£¬ºóÀ´ÔÙ¼ì²éʲôÊý¾ÝҲû½øÈ¥£¬Ò»¸ö±í¶¼Ã»¹ýÈ¥¡£³ýÁ˲ÎÊýÉèÖã¬ÆäËüµÄÑ¡ÏĬÈϾͿÉÒÔ£¬Èç¹ûÊý¾Ý¿â×Ö¶ÎÓÐÖÐÎÄ£¬¼Çסһ¶¨Òª¸Ä±äÊý¾Ý¿â±àÂëµÄÑ¡Ïî¡£
Êý¾ÝǨÒÆÍê³É,½ÓÏÂÀ´ÊdzÌÐòµÄÐ޸Ť×÷ÁË,ÓÖÒªÁîÈ˲»Êæ·þ. ......

½«AccessµÄÄÚÈÝǨÒƵ½MySQLÊý¾Ý¿â

Ô­±¾µÄÄ¿µÄÊǽ«Êý¾Ý¿â´ÓMS SQL 2000ǨÒƵ½MySQLÖУ¬µ«ÌáʾJDBCÁ¬½Óʧ°Ü£¬ÎÞÄÎÖ®¼«£¬Ö»ºÃÑ¡ÔñÖмäÇÅÁºAccessÍê³ÉÕâÏîÁîÈËÌÖÑáµÄ¹¤×÷ÁË¡£
´ó¸Å²½ÖèÈçÏ£º
1£¬´ÓMS SQL 2000½«Êý¾Ýµ¼³öµ½AccessÖУ¬ÓÐ¹Ø±í¶¨ÒåºÃÖ÷¼üºÍ×Ô¶¯±àºÅ²¿·Ö²»È»Ç¨ÒƺóÓÖµÃÐÞ¸ÄMySQLµÄ±í¡£
2£¬ÐÞ¸ÄAccess±íÖйÜÀíÔ±×é¡¢¹ÜÀíÔ±µÄȨÏÞ£¬±£Ö¤AccessµÄÄÚÖÃϵͳ±íÄÜÕý³£·ÃÎÊ£¬ÏêϸÇë²Î¿¼MySQL Migration Toolkit°ïÖúÖеIJ¿·Ö:Chapter 13. Preparing a Microsoft Access Database for Migration¡£
3£¬´ò¿ªMySQL Migration Toolkit£¬ÉèÖúÃÓйزÎÊý½øÐÐǨÒƲÙ×÷¡£×¢Òâ¿´Çå³þ½çÃæÉϵÄÌáʾ£¬²»Òª°ÑËùÓÐ±í¶¼¼ÓÈëµ½ÒªºöÂԵıíÇåµ¥£¬ÎÒµÚÒ»´Îû¿´¾ÍÈ«·Å½øÈ¥ÁË£¬ºóÀ´ÔÙ¼ì²éʲôÊý¾ÝҲû½øÈ¥£¬Ò»¸ö±í¶¼Ã»¹ýÈ¥¡£³ýÁ˲ÎÊýÉèÖã¬ÆäËüµÄÑ¡ÏĬÈϾͿÉÒÔ£¬Èç¹ûÊý¾Ý¿â×Ö¶ÎÓÐÖÐÎÄ£¬¼Çסһ¶¨Òª¸Ä±äÊý¾Ý¿â±àÂëµÄÑ¡Ïî¡£
Êý¾ÝǨÒÆÍê³É,½ÓÏÂÀ´ÊdzÌÐòµÄÐ޸Ť×÷ÁË,ÓÖÒªÁîÈ˲»Êæ·þ. ......

Access ·ÖÒ³²éѯ

   ×Ô¼º×öµÄÒ»¸ö.net´íÎóÊÕ¼¯£¬ÊÕ¼¯ÕûÕ¾µÄ500´íÎó£¬ÓõÄaccessÊý¾Ý¿â¡£Êý¾Ý¹ý20000ºó£¬Ê¹Óô«Í³µÄSELECT TOP 10 * from TABLE WHERE ID NOT IN(SELECT TOP 10*10 * from TABLE)²éѯ¾¹È»ÒªºÃ¼¸·ÖÖÓ£¬º¹~~~~£¡
   ÍøÉϲ鵽µÄÒ»ÌõÓï¾ä»¹²»´í¡£
    SELECT TOP 10 id,Message,CreateTime from errMessage where (id > (SELECT MAX(id) from (SELECT TOP 10 id from errMessage ORDER BY id ) AS T)) ORDER BY ID
   ¸ù¾Ý×î´óµÄIDÀ´²é£¬±ØÐëÒªÓÐÒ»¸ö×ÔÔö³¤µÄ±êʶÁм´¿É£¡ ......

ADOX´´½¨AccessÓû§ºÍ×é

// BeginGroupCpp.cpp
// compile with: /EHsc
#import "msadox.dll" no_namespace
#include "iostream"
using namespace std;
inline void TESTHR(HRESULT x) {if FAILED(x) _com_issue_error(x);};
int main() {
   if (FAILED(::CoInitialize(NULL)) )
      return -1;
   HRESULT hr = S_OK;
   // Define and initialize ADOX object pointers. These are in ADODB namespace.
   _CatalogPtr m_pCatalog = NULL;
   _UserPtr m_pUserNew = NULL;
   _UserPtr m_pUser = NULL;
   _GroupPtr m_pGroup = NULL;
   // Define String Variables.
   _bstr_t strCnn("Provider=Microsoft.Jet.OLEDB.4.0;User ID=myUsername;Data Source=C:\mydatabase.mdb;Jet OLEDB:Password=myPassword;Jet OLEDB:System Database=system.mdw;");
   try {
      TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (Catalog)));
      m_pCatalog->PutActiveConnection(strCnn); ......

VS2005ÖУ¬access¶ÔÖ»¶ÁĿ¼µÄÊôÐÔÅжϲ»×¼È·

Ö»¶ÁĿ¼£¬
C:\>attrib +A +S +H +R testdir
C:\>attrib testdir
A  SHR     C:\testdir
(1)VC6.0µÄÖ´Ðнá¹û£º
***********test stat***********************
file [c:\testdir] exists!
file [c:\testdir] is directory!
file [c:\testdir] can be read!
file [c:\testdir] can not be writed!
***********test access***********************
file [c:\testdir] exists!
file [c:\testdir] can not be writed!
file [c:\testdir] can be read!
(2)VS2005µÄÖ´Ðнá¹û
***********test stat***********************
file [c:\testdir] exists!
file [c:\testdir] is directory!
file [c:\testdir] can be read!
file [c:\testdir] can not be writed!
***********test access***********************
file [c:\testdir] exists!
file [c:\testdir] can be writed!
file [c:\testdir] can be read!
½áÂÛ£ºÔÚVS2005ÖУ¬Ê¹ÓÃaccessÅжϵÄÖ»¶ÁĿ¼ȴÓС¾Ð´Èë¡¿µÄÊôÐÔ¡£
         ÓÐʲô¸ßÕУ¬»¶Ó­½â´ð¡£
½¨Ò飬ÔÚVS2005ÖжÔÎļþ¡¢Ä¿Â¼½øÐÐȨÏÞУÑéʱ£¬×îºÃ²»ÒªÓÃaccess¡£
#inc ......

ΪaccessÊý¾Ý¿â´´½¨ÓµÓв»Í¬·ÃÎÊȨÏÞµÄÓû§

      JavaÅàѵ¿Î³ÌÖ®Êý¾Ý¿â¼¼Êõѧϰ
      ¿´µ½ºÜ¶à³õѧÕß·´¸´ÎÊÕâ¸öÎÊÌ⣬дÁËÒ»¸öºÜ¼òµ¥µÄÒ»¸ö½Å±¾£¬ÓÃÓÚ×Ô¶¯ÉèÖû·¾³±äÁ¿¡£°Ñ´úÂ뿽±´£¬Áí´æΪjavaEnv.bat¡£°²×°ÍêJava 2 SDKÖ®ºó£¬¿ªÒ»¸öÃüÁîÐд°¿Ú,ÊäÈëjavaEnv java2SDKDir(java2SDKDirÊÇÄãµÄjavaµÄ°²×°Ä¿Â¼£¬²»´ø·¾¶×îºóµÄ\¡£Èç¹û°²×°Â·¾¶ÖÐÓпոñ£¬ÇëÓÃjavaEnv "java2SDKDir"¸ñʽ)²¢ÔËÐС£(×¢£ºÒ»¶¨ÒªÔÚjavaEnvºó±ß¼ÓÉÏÄãµÄsdkµÄĿ¼)
@echo ÄãÌṩµÄjdk°²×°Ä¿Â¼Îª£º%1
@echo off
IF EXIST %1\bin\java.exe (
rem ÈçÊäÈëÕýÈ·µÄ Java2SDK °²×°Ä¿Â¼£¬¿ªÊ¼ÉèÖû·¾³±äÁ¿
@setx JAVA_HOME %1
@setx path %JAVA_HOME%\bin;%path%
@setx classpath %classpath%;.
@setx classpath %classpath%;%JAVA_HOME%\lib\tools.jar
@setx classpath %classpath%;%JAVA_HOME%\lib\dt.jar
@setx classpath %classpath%;%JAVA_HOME%\jre\lib\rt.jar
@echo on
@echo Java 2 SDK »·¾³²ÎÊýÉèÖÃÍê±Ï£¬Õý³£Í˳ö¡£
) ELSE (
IF %1=="" (
rem ÈçûÓÐÌṩ°²×°Ä¿Â¼£¬Ìáʾ֮ºóÍ˳ö
@echo on
@echo ûÓÐÌṩ Java2SDK µÄ° ......

SQL2005ºÍ(Excel |access)Ö®¼äµÄÊý¾Ýµ¼Èëµ¼³ö


Sql´úÂë
--²ÉÓÃSQLÓï¾äʵÏÖsql2005ºÍExcel Êý¾ÝÖ®¼äµÄÊý¾Ýµ¼Èëµ¼³ö£¬ÔÚÍøÉÏÕÒÀ´Ò»--Ï£¬ÊµÏÖ·½·¨ÊÇÕâÑùµÄ£º    
  
  
--Excel---->SQL2005  µ¼È룺    
  
  
select * into useinfo from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=d:\db.xls',sheet1$);    
  
  
  
--ÆäÖУ¬useinfo ÊÇÊý¾Ý¿âÖеÄÒ»¸ö±í£¬d:\db.xls ÎªÊý¾ÝÔ´£¬ÖµµÃÌá³öµÄÊÇ£º--sheet1$£¬¼ÇµÃ¼ÓÉÏ$¡£    
  
  
---SQL2005--->Excel  µ¼³ö£º    
  
  
insert into OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=d:\test.xls',sheet1$) select * from useinfo;    
  
  
  
  
--н¨Ò»¸ötest.xml Îļþ£¬ÆäÖÐtest.xmlµÄsheet1 µÄ±íÍ·± ......

SQL2005ºÍ(Excel |access)Ö®¼äµÄÊý¾Ýµ¼Èëµ¼³ö


Sql´úÂë
--²ÉÓÃSQLÓï¾äʵÏÖsql2005ºÍExcel Êý¾ÝÖ®¼äµÄÊý¾Ýµ¼Èëµ¼³ö£¬ÔÚÍøÉÏÕÒÀ´Ò»--Ï£¬ÊµÏÖ·½·¨ÊÇÕâÑùµÄ£º    
  
  
--Excel---->SQL2005  µ¼È룺    
  
  
select * into useinfo from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=d:\db.xls',sheet1$);    
  
  
  
--ÆäÖУ¬useinfo ÊÇÊý¾Ý¿âÖеÄÒ»¸ö±í£¬d:\db.xls ÎªÊý¾ÝÔ´£¬ÖµµÃÌá³öµÄÊÇ£º--sheet1$£¬¼ÇµÃ¼ÓÉÏ$¡£    
  
  
---SQL2005--->Excel  µ¼³ö£º    
  
  
insert into OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=d:\test.xls',sheet1$) select * from useinfo;    
  
  
  
  
--н¨Ò»¸ötest.xml Îļþ£¬ÆäÖÐtest.xmlµÄsheet1 µÄ±íÍ·± ......
×ܼǼÊý:314; ×ÜÒ³Êý:53; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [44] [45] [46] [47] [48] [49] [50] [51] 52 [53]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ