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
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\trade.mdb'; 'admin'; '', ±íÃû)
SELECT *
from
Ïà¹ØÎĵµ£º
°²×°Íê±ÏÖ®ºó£¬»¹ÐèÒªÉèÖÃһϲÅÄÜʹsql·þÎñÁ´½Ó³É¹¦¡£ Ñ¡ÔñµÚÒ»¸ö£º·þÎñºÍÁ´½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷ µã»÷¡°Ô¶³ÌÁ´½Ó¡±£¬ÔÙÑ¡Ôñ±¾µØÁ´½ÓºÍÔ¶³ÌÁ´½Ó¡£Ñ¡ÔñµÚ3¸öÑ¡Ïî¡£ ºÃÁË¡£ÎÒÃÇ¿ÉÒÔµ½¿ªstudioÁË¡£ ¼ÇµÃÔÚ·þÎñÆ÷Ãû³ÆÊäÈ룺localhost\SQLEXPRESS
µÇ¼Ãûsa¡£ÃÜÂë¾ÍÊÇ°²×°µÄʱºòÊäÈëµÄÃÜÂë¡£ ok¡£¡£¡£ºÃÁË¡£¡£¡£¡ ......
Ô±¾µÄÄ¿µÄÊǽ«Êý¾Ý¿â´ÓMS SQL 2000ǨÒƵ½MySQLÖУ¬µ«ÌáʾJDBCÁ¬½Óʧ°Ü£¬ÎÞÄÎÖ®¼«£¬Ö»ºÃÑ¡ÔñÖмäÇÅÁºAccessÍê³ÉÕâÏîÁîÈËÌÖÑáµÄ¹¤×÷ÁË¡£
´ó¸Å²½ÖèÈçÏ£º
1£¬´ÓMS SQL 2000½«Êý¾Ýµ¼³öµ½AccessÖУ¬ÓÐ¹Ø±í¶¨ÒåºÃÖ÷¼üºÍ×Ô¶¯±àºÅ²¿·Ö²»È»Ç¨ÒƺóÓÖµÃÐÞ¸ÄMySQLµÄ±í¡£
2£¬ÐÞ¸ÄAccess±íÖйÜÀíÔ±×é¡¢¹ÜÀíÔ±µÄȨÏÞ£¬±£Ö¤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;
&n ......
Ö»¶ÁĿ¼£¬
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 n ......
ϵͳ»·¾³£ºwindows xp
Èí¼þ»·¾³£ºC£«£« builder 6.0
±¾´ÎÄ¿µÄ£ºÍê³ÉÒ»¸ö¼òÒ×È´²»Ê§»ªÀöµÄ½øÏú´æ¹ÜÀíϵͳ¡£
ÕâÊÇ°ëÄêÇ°×÷µÄÒ»¸ö¿Î³ÌÉè¼Æ£¬ÓõÄBCB+ACCESSÊý¾Ý¿âÍê³ÉµÄ£¬½çÃæÃÀ»¯ÊÇÓõÄBusinessSkinForm5.25ºº»¯°æ£¬ËüÊÇBCBµÄµÚÈý·½¿Ø¼þ£¬Ê¹ÓñȽϷ½±ã£¬ÍøÉÏÓкܶàÌ×Ƥ·ô¿É¹©Ï ......