国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

異構數據庫之間的導入導出

2024-07-21 02:31:30
字體:
來源:轉載
供稿:網友

異構數據庫之間的導入導出

//MSSQL2Excel
ADOConnection1.ConnectionString:=
'PRovider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/yp.xls;'
+'Extended Properties=excel 8.0';
ADOConnection1.Execute('select * into [Abc] from drug_yk IN [ODBC] [ODBC;Driver=SQL

Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]');
//把一個MSSQL的數據庫表及數據導出到excel中,abc為excel中不存在的表名,drug_yk為MSSQL里的表, sa為

用戶,  kcsoft58為密碼 , 127.0.0.1為服務大地址 ,kcsoft_his是數據庫名稱
ADOConnection1.Execute('insert into [abc] select * from drug_yk in [ODBC] [ODBC;Driver=SQL

Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]');
//把一個MSSQL的數據庫表的記錄增加到到excel中,執行以后相當于兩倍量的數據,一次是導入,一次是

insert


//EXCEL2MSSQL
  ADOConnection1.ConnectionString:='Provider=SQLOLEDB.1;PassWord=KCSOFT58;Persist Security

Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN';
   ADOConnection1.Execute('SELECT * into [abc] FROM OpenDataSource( '
   +QuotedStr('Microsoft.Jet.OLEDB.4.0')+','
   +QuotedStr('Data Source="G:/mysmallexe/excel2sql/yp.xls";Extended Properties=excel 8.0')

+')...[Abc]');


//MSSQL2VFP
  ADOConnection2.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql;'
+'Extended Properties=dBase 5.0';
ADOConnection2.Execute('select * into Abc.dbf from drug_yk IN [ODBC] [ODBC;Driver=SQL

Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]');
//把一個MSSQL的數據庫表及數據導出到VFP中,Abc.dbf 為VFP中不存在的表名,drug_yk為MSSQL里的表, sa為

用戶,  kcsoft58為密碼 , 127.0.0.1為服務大地址 ,kcsoft_his是數據庫名稱


//VFP2MSSQL
   ADOConnection2.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security

Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN';
   ADOConnection2.Execute('SELECT * into [abc] FROM OpenDataSource( '
   +QuotedStr('Microsoft.Jet.OLEDB.4.0')+','
   +QuotedStr('Data Source="G:/mysmallexe/excel2sql";Extended Properties=dBase 5.0')+')...

[Abc]');


 //MSSQL2access
     ADOConnection2.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/Server.MDB;'
+'Persist Security Info=False;Jet OLEDB:Database Password=happynewyear';
ADOConnection2.Execute('select * into Abc from drug_yk IN [ODBC] [ODBC;Driver=SQL

Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]');


//access2MSSQL
  ADOConnection2.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security

Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN';
   ADOConnection2.Execute('SELECT * into [abc] FROM OpenDataSource( '
   +QuotedStr('Microsoft.Jet.OLEDB.4.0')+','
   +QuotedStr('Data Source="G:/mysmallexe/excel2sql/Server.MDB";Jet OLEDB:Database

Password=happynewyear')+')...[Abc]');


//excel2access
    ADOConnection2.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/Server.MDB;'
+'Persist Security Info=False;Jet OLEDB:Database Password=happynewyear';
ADOConnection2.Execute('SELECT * into [abc] FROM [excel

8.0;database=G:/mysmallexe/excel2sql/yp.xls].[abc$]');

//access2excel
   ADOConnection2.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/yp.xls;'
+'Extended Properties=excel 8.0';
ADOConnection2.Execute('SELECT * into abc  from

[G:/mysmallexe/excel2sql/Server.MDB;pwd=happynewyear].abc');


//MSSQL2txt
 ADOConnection2.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql;'
+'Extended Properties=text';
ADOConnection2.Execute('select * into Abc#txt from drug_yk IN [ODBC] [ODBC;Driver=SQL

Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]');


//txt2MSSQL
   ADOConnection2.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security

Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN';
    ADOConnection2.Execute('SELECT * into [abc] FROM OpenDataSource( '
   +QuotedStr('Microsoft.Jet.OLEDB.4.0')+','
   +QuotedStr('Data Source="G:/mysmallexe/excel2sql";Extended Properties=text')+')...

[Abc#txt]');


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新密市| 新河县| 治县。| 邯郸县| 庆元县| 清新县| 上饶县| 腾冲县| 都江堰市| 稷山县| 临安市| 南江县| 加查县| 石景山区| 桂阳县| 蒙城县| 台州市| 团风县| 淮滨县| 桃江县| 上饶市| 敦煌市| 张家口市| 克拉玛依市| 襄樊市| 疏勒县| 化德县| 响水县| 黄冈市| 清丰县| 涡阳县| 兴国县| 怀远县| 屏边| 鄂州市| 三江| 柏乡县| 柯坪县| 丽水市| 安阳县| 铜川市|