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

SQL SERVERÓëACCESS,EXCELµÄÊý¾Ýת»»

ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚTransact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXCELÊý¾Ýת»»£¬Ïêϸ˵Ã÷ÈçÏ£º
Ò»¡¢SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡ð1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡ð2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºóÑ¡Ôñ  czdImport Data£¨µ¼ÈëÊý¾Ý£©¡£
¡ð3ÔÚChoose a Data Source£¨Ñ¡ÔñÊý¾ÝÔ´£©¶Ô»°¿òÖÐÑ¡ÔñMicrosoft Access as the Source£¬È»ºó¼üÈëÄãµÄ.mdbÊý¾Ý¿â(.mdbÎļþÀ©Õ¹Ãû)µÄÎļþÃû»òͨ¹ýä¯ÀÀÑ°ÕÒ¸ÃÎļþ¡£
¡ð4ÔÚChoose a Destination£¨Ñ¡ÔñÄ¿±ê£©¶Ô»°¿òÖУ¬Ñ¡ÔñMicrosoft OLE DB Prov ider for SQL Server£¬Ñ¡ÔñÊý¾Ý¿â·þÎñÆ÷£¬È»ºóµ¥»÷±ØÒªµÄÑéÖ¤·½Ê½¡£
¡ð5ÔÚSpecify Table Copy£¨Ö¸¶¨±í¸ñ¸´ÖÆ£©»òQuery£¨²éѯ£©¶Ô»°¿òÖУ¬µ¥»÷Copy tables£¨¸´ÖƱí¸ñ£©¡£
    ¡ð6ÔÚSelect Source Tables£¨Ñ¡ÔñÔ´±í¸ñ£©¶Ô»°¿òÖУ¬µ¥»÷Select All£¨È«²¿Ñ¡¶¨£©¡£ÏÂÒ»²½£¬Íê³É¡£
Transact-SQLÓï¾ä½øÐе¼Èëµ¼³ö£º
1.ÔÚSQL SERVERÀï²éѯaccessÊý¾Ý:
SELECT *
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\DB.mdb";User ID=Admin;Password=')...±íÃû
2.½«accessµ¼ÈëSQL server
ÔÚSQL SERVER ÀïÔËÐÐ:
SELECT *
INTO newtable
from OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0',
      'Data Source="c:\DB.mdb";User ID=Admin;Password=' )...±íÃû
3.½«SQL SERVER±íÀïµÄÊý¾Ý²åÈëµ½Access±íÖÐ
ÔÚSQL SERVER ÀïÔËÐУº
insert into OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
  'Data Source=" c:\DB.mdb";User ID=Admin;Password=')...±íÃû
(ÁÐÃû1,ÁÐÃû2)
select ÁÐÃû1,ÁÐÃû2  from  sql±í
ʵÀý£º
insert into  OPENROWSET('Microsoft.Jet.OLEDB.4.0',
   'C:\db.mdb';'admin';'', Test)
select id,name from Test


Ïà¹ØÎĵµ£º

OleDbType ö¾ÙÓë Microsoft Access Êý¾ÝÀàÐÍ

×î³£¼ûµÄÊý¾ÝÀàÐÍÓ³ÉäµÄÁбí
ϱíÁгöÁËÔÚ Microsoft Access ºÍÈçºÎÕâЩÊý¾ÝÀàÐÍÓëÏà¹Ø Microsoft.net ¿ò¼ÜÊý¾ÝÀàÐÍ£¬²¢ OleDbType ö¾ÙÖÐʹÓÃ×î³£¼ûµÄÊý¾ÝÀàÐÍ¡£
ÊÕÆð¸Ã±í¸ñÕ¹¿ª¸Ã±í¸ñ
·ÃÎÊÀàÐÍÃû³Æ
Êý¾Ý¿âÊý¾ÝÀàÐÍ
OLE DB ÀàÐÍ
.NET ¿ò¼ÜÀàÐÍ
³ÉÔ±Ãû³Æ
Îı¾
VarWChar
DBTYPE_WSTR
System.String
OleDbType.V ......

Mysql µ¼Èë .sqlÎļþÖÐÎÄÂÒÂ룿

 --default-character-set=utf8 ÓëÐÞ¸ÄsqlÎļþ¼ÓÈ룺SET NAMES 'utf8'; 
µ¼Èë½Å±¾Ê±£¬SET NAMES 'xxx' £¬xxxÓ¦¸ÃºÍsql½Å±¾ÎļþµÄʵ¼Ê±àÂëÒ»Ö£¬Èç¹ûÄãÉèÖõÄʱutf-8 £¬ÄÇôÇëÈ·ÈÏÄãµÄsql½Å±¾Îļþʱutf-8±£´æµÄ:
iconv -f UTF-8 xxx.sql
Èç¹ûÏÔʾÕý³££¬ÄÇôÕâÒ»²½¾ÍOKÁË
ÁíÍâ×¢ÒâÄãµÄ½Å±¾ÀÓÐûÓиø¿â±íÉèÖ ......

VC/MFCÖеÄACCESSÊý¾Ý¿â·ÃÎÊʵÏÖ(·½·¨3)

½Ó 2
·½·¨3 :
ÕâÖÖ·½·¨Ò²ÐèÒªÓû§×Ô¼º´´½¨Ò»¸öÊý¾ÝÔ´£¬µ«ÊÇ£¬ËùÐèÒª½øÐеIJ½Ö裬±È·½·¨2ÒªÉÙÉÏÐí¶à¡£
´´½¨ºÃÓû§±í¡£
´´½¨Êý¾ÝÔ´£¨¿ØÖÆÃæ°å->Êý¾Ý¹ÜÀí->Êý¾ÝÔ´ Ë«»÷ -> Ñ¡Ôñ Îļþ DSN -> Ìí¼Ó -> Microsoft Access Driver -> ÊÖ¶¯ÊäÈëDSN ±£´æµÄλÖü°Ãû³Æ -> Ñ¡Ôñ(S) ²¢Ñ¡ ......

Ïê½âAsp.Net SqlÊý¾Ý¿âÁ¬½Ó×Ö·û´®


1.Á¬½ÓÊý¾Ý¿âÎļþ
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />
SqlConnectionStringBuilderʵÀý»¯Ê±£¬ÒªÓõ½connectionString£¬È磺SqlConnectionStringBuild builder = new SqlC ......

ORACLE·ÖÒ³²éѯSQLÓï·¨


--1:ÎÞORDER BYÅÅÐòµÄд·¨¡£(ЧÂÊ×î¸ß) ­
--(¾­¹ý²âÊÔ£¬´Ë·½·¨³É±¾×îµÍ£¬Ö»Ç¶Ì×Ò»²ã£¬ËÙ¶È×î¿ì£¡¼´Ê¹²éѯµÄÊý¾ÝÁ¿ÔÙ´ó£¬Ò²¼¸ºõ²»ÊÜÓ°Ï죬ËÙ¶ÈÒÀÈ»£¡) ­
SELECT * ­
  from (Select ROWNUM AS ROWNO, T.* ­
           from k_task T &s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ