[Òý]SQLServerºÍAccess¡¢ExcelÊý¾Ý´«Êä¼òµ¥×ܽá
http://www.tongyi.net/article/20031101/200311013786.shtml
ËùνµÄÊý¾Ý´«Ê䣬ÆäʵÊÇÖ¸SQLServer·ÃÎÊAccess¡¢Excel¼äµÄÊý¾Ý¡£
ΪʲôҪ¿¼Âǵ½Õâ¸öÎÊÌâÄØ£¿
ÓÉÓÚÀúÊ·µÄÔÒò£¬¿Í»§ÒÔÇ°µÄÊý¾ÝºÜ¶à¶¼ÊÇÔÚ´æÈëÔÚÎı¾Êý¾Ý¿âÖУ¬ÈçAcess¡¢Excel¡¢Foxpro¡£ÏÖÔÚϵͳÉý¼¶¼°Êý¾Ý¿â·þÎñÆ÷ÈçSQLServer¡¢ORACLEºó£¬¾³£ÐèÒª·ÃÎÊÎı¾Êý¾Ý¿âÖеÄÊý¾Ý£¬ËùÒԾͻá²úÉúÕâÑùµÄÐèÇó¡£Ç°¶Îʱ¼ä³ö²îµÄÏîÄ¿£¬¾ÍÊÇÃæÁÙÕâÑùµÄÒ»¸öÎÊÌ⣺SQLServerºÍVFPÖ®¼äµÄÊý¾Ý½»»»¡£
ÒªÍê³É±êÌâµÄÐèÒª£¬ÔÚSQLServerÖÐÊÇÒ»¼þ·Ç³£¼òµ¥µÄÊÂÇé¡£
ͨ³£µÄ¿ÉÒÔÓÐ3ÖÖ·½Ê½£º1¡¢DTS¹¤¾ß 2¡¢BCP 3¡¢·Ö²¼Ê½²éѯ
DTS¾Í²»ÐèҪ˵ÁË£¬ÒòΪÄÇÊÇͼÐλ¯²Ù×÷½çÃ棬ºÜÈÝÒ×ÉÏÊÖ¡£
ÕâÀïÖ÷Òª½²ÏºóÃæÁ½ÃÇ£¬·Ö±ðÒԲ顢Ôö¡¢É¾¡¢¸Ä×÷Ϊ¼òµ¥µÄÀý×Ó£º
ÏÂÃæ·Ï»°¾Í²»ËµÁË£¬Ö±½ÓÒÔT-SQLµÄÐÎʽ±íÏÖ³öÀ´¡£
Ò»¡¢SQLServerºÍAccess
1¡¢²éѯAccessÖÐÊý¾ÝµÄ·½·¨£º
select * from OpenRowSet('microsoft.jet.oledb.4.0',';database=c:\db2.mdb','select * from serv_user')
»ò
select * from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="c:\DB2.mdb";User ID=Admin;Password=')...serv_user
2¡¢´ÓSQLServerÏòAccessдÊý¾Ý£º
insert into OpenRowSet('microsoft.jet.oledb.4.0',';database=c:\db2.mdb','select * from Accee±í')
select * from SQLServer±í
»òÓÃBCP
master..xp_cmdshell'bcp "serv-htjs.dbo.serv_user" out "c:\db3.mdb" -c -q -S"." -U"sa" -P"sa"'
ÉÏÃæµÄÇø±ðÖ÷ÒªÊÇ£ºOpenRowSetÐèÒªmdbºÍ±í´æÔÚ£¬BCP»áÔÚ²»´æÔÚµÄʱºòÉú³É¸Ãmdb
3¡¢´ÓAccessÏòSQLServerдÊý¾Ý£ºÓÐÁËÉÏÃæµÄ»ù´¡£¬Õâ¸ö¾ÍºÜ¼òµ¥ÁË
insert into SQLServer±í select * from
OpenRowSet('microsoft.jet.oledb.4.0',';database=c:\db2.mdb','select * from Accee±í')
»òÓÃBCP
master..xp_cmdshell'bcp "serv-htjs.dbo.serv_user" in "c:\db3.mdb" -c -q -S"." -U"sa" -P"sa"'
4¡¢É¾³ýAccessÊý¾Ý£º
delete from OpenRowSet('microsoft.jet.oledb.4.0',';database=c:\db2.mdb','select * from serv_user')
where lock=0
5¡¢ÐÞ¸ÄAccessÊý¾Ý£º
update OpenRowSet('microsoft.jet.oledb.4.0',';database=c:\db2.mdb','select * from serv_user')
set lock=1
SQLServerºÍAccess´óÖ¾ÍÕâô¶à¡£
¶þ¡¢SQLServerºÍExcel
1¡¢ÏòExcel²éѯ
select * from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;HD
Ïà¹ØÎĵµ£º
±¾À´¿¼ÂÇÓÃXMLÎļþÀ´´æÊý¾ÝÊÇÒòΪÆä¿çƽ̨ÐÔ£¬¶øÇÒ²»Óð²×°Ìض¨µÄÈí¼þ¡£µ«¾¹ýÑо¿ÁËÒ»Õó×Ó·¢ÏÖ£¬XMLÓÃÓÚ´æ·ÅÉÙÊý¾ÝÊÇ¿ÉÒÔ£¬µ«´æ·Å´óÖÐÐÍÊý¾Ý¾ÍÏԵúܳÔÁ¦£¬»³ÒÉҲûÓÐÈË»áÕâô×ö¡£¶øÈç¹û²ÉÓÃSQL SERVER´æÊý¾Ý£¬ÓÖÏԵñȽÏÇü²Å£¬±Ï¾¹ÎÒ×öµÄÖ»ÊÇÑо¿¿Í»§¶ËµÄÒ»¸öС³ÌÐò£¬ÅäÖôú¼ÛҲ̫´óÁË¡£»ùÓÚÕâÁ½ÕßÖ®¼ä£¬»¹ÊǾö¶¨Ñ ......
×î½üÒòΪҪдһ¸öÊý¾Ý²¢·¢·ÃÎʵĿØÖƳÌÐò£¬ÉÏÍø²éÁËһЩ×ÊÁÏ£¬ÏÖÔÚ¹éÄÉÈçÏ£º ËøµÄ¸ÅÊö Ò». ΪʲôҪÒýÈëËø
¶à¸öÓû§Í¬Ê±¶ÔÊý¾Ý¿âµÄ²¢·¢²Ù×÷ʱ»á´øÀ´ÒÔÏÂÊý¾Ý²»Ò»ÖµÄÎÊÌ⣺
¶ªÊ§¸üÐÂ
A£¬BÁ½¸öÓû§¶ÁͬһÊý¾Ý²¢½øÐÐÐ޸ģ¬ÆäÖÐÒ»¸öÓû§µÄÐ޸Ľá¹ûÆÆ»µÁËÁíÒ»¸öÐ޸ĵĽá ......
µ±È»£¬altera FPGA µÄJTAGºÍASÏÂÔØģʽÊǵÃÕâô½Ó¡£µ«ÊÇ£¬ÎÒÓиöСÌáÐѸø¸÷λ£ºÇë×¢ÒâVCCAµÄ¶¨Ò壬VCCAÊÇͬʱ¸øFPGAËøÏ໷·¹©µçµÄ2.5V¡£ÔÚËøÏà»·Òý½ÅÉÏÎÒ½ÓÓÐ0.01uFµÄµçÈÝ£¬¿ÉÒÔÏëÏóËüÄܹ»ÒƳý´óÔ¼100MHzÒÔÉϵÄÉäƵÄÜÁ¿£¬Òò´Ë¶ÔJTAGÏÂÔØ¿ÚµÄÆäÉÏÀ×÷ÓõÄVCCAÓ°Ïì²»´ó£¨JTAGÅäÖÃģʽµÄ´ø¿í²¢²»¸ß£©£¬0.01uFµÄµçÈݲ»¿ÉÄÜ¶Ô ......
ÏÂÃæ¸ø³öÁËʹÓÃC# ¿ª·¢µÄÒ»¸öѹËõACCESSÊý¾Ý¿âµÄ³ÌÐò
ÏñFolderBrowserDialog£¨ÓÃÓÚä¯ÀÀÑ¡ÔñÎļþ¼ÐµÄ¶Ô»°¿ò£©¡¢MessageBox£¨ÏûÏ¢´¦Àí¶Ô»°¿ò£©¡¢DirectoryInfo£¨Ä¿Â¼ÐÅÏ¢£¬¿ÉÓÃÓÚ´´½¨¡¢¼ì²âÊÇ·ñ´æÔڵȶÔĿ¼µÄ²Ù×÷£©¡¢FileInfo£¨ÎļþÐÅÏ¢£¬¿ÉÓÃÓÚÎļþµÄ¼ì²â¡¢ÎļþÐÅÏ¢µÄ»ñÈ¡¡¢¸´ÖƵȲÙ×÷£©¡¢DataGridView£¨Êý¾Ý±í¸ñ¿Ø¼þ£¬ÓÃÓ ......