|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
客户还是可以使用DBaaS系统所能提供的所有能力。数据库云服务消除了组织对专职人员、本地数据库存储设备的需要。他们不必安装、配置和维护任何软硬件。数据|数据库异构数据库之间的导进导出
//MSSQL2EXCEL
ADOConnection1.ConnectionString:=
Provider=Microsoft.Jet.OLEDB.4.0;DataSource=G:mysmallexeexcel2sqlyp.xls;
+ExtendedProperties=excel8.0;
ADOConnection1.Execute(select*into[Abc]fromdrug_ykIN[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(insertinto[abc]select*fromdrug_ykin[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;PersistSecurity
Info=True;UserID=SA;InitialCatalog=KCSOFT_HIS;DataSource=CHEN;
ADOConnection1.Execute(SELECT*into[abc]FROMOpenDataSource(
+QuotedStr(Microsoft.Jet.OLEDB.4.0)+,
+QuotedStr(DataSource="G:mysmallexeexcel2sqlyp.xls";ExtendedProperties=excel8.0)
+)...[Abc]);
//MSSQL2VFP
ADOConnection2.ConnectionString:=
Provider=Microsoft.Jet.OLEDB.4.0;DataSource=G:mysmallexeexcel2sql;
+ExtendedProperties=dBase5.0;
ADOConnection2.Execute(select*intoAbc.dbffromdrug_ykIN[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;PersistSecurity
Info=True;UserID=SA;InitialCatalog=KCSOFT_HIS;DataSource=CHEN;
ADOConnection2.Execute(SELECT*into[abc]FROMOpenDataSource(
+QuotedStr(Microsoft.Jet.OLEDB.4.0)+,
+QuotedStr(DataSource="G:mysmallexeexcel2sql";ExtendedProperties=dBase5.0)+)...
[Abc]);
//MSSQL2access
ADOConnection2.ConnectionString:=
Provider=Microsoft.Jet.OLEDB.4.0;DataSource=G:mysmallexeexcel2sqlServer.MDB;
+PersistSecurityInfo=False;JetOLEDB:DatabasePassword=happynewyear;
ADOConnection2.Execute(select*intoAbcfromdrug_ykIN[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;PersistSecurity
Info=True;UserID=SA;InitialCatalog=KCSOFT_HIS;DataSource=CHEN;
ADOConnection2.Execute(SELECT*into[abc]FROMOpenDataSource(
+QuotedStr(Microsoft.Jet.OLEDB.4.0)+,
+QuotedStr(DataSource="G:mysmallexeexcel2sqlServer.MDB";JetOLEDB:Database
Password=happynewyear)+)...[Abc]);
//excel2access
ADOConnection2.ConnectionString:=
Provider=Microsoft.Jet.OLEDB.4.0;DataSource=G:mysmallexeexcel2sqlServer.MDB;
+PersistSecurityInfo=False;JetOLEDB:DatabasePassword=happynewyear;
ADOConnection2.Execute(SELECT*into[abc]FROM[excel
8.0;database=G:mysmallexeexcel2sqlyp.xls].[abc$]);
//access2excel
ADOConnection2.ConnectionString:=
Provider=Microsoft.Jet.OLEDB.4.0;DataSource=G:mysmallexeexcel2sqlyp.xls;
+ExtendedProperties=excel8.0;
ADOConnection2.Execute(SELECT*intoabcfrom
[G:mysmallexeexcel2sqlServer.MDB;pwd=happynewyear].abc);
//MSSQL2txt
ADOConnection2.ConnectionString:=
Provider=Microsoft.Jet.OLEDB.4.0;DataSource=G:mysmallexeexcel2sql;
+ExtendedProperties=text;
ADOConnection2.Execute(select*intoAbc#txtfromdrug_ykIN[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;PersistSecurity
<P>Info=True;UserID=SA;InitialCatalog=KCSOFT_HIS;DataSource=CHEN;
ADOConnection2.Execute(SELECT*into[abc]FROMOpenDataSource(
+QuotedStr(Microsoft.Jet.OLEDB.4.0)+,
+QuotedStr(DataSource="G:mysmallexeexcel2sql";ExtendedProperties=text)+)... |
|