Home > Back-end >  Delphi7 how to specify the Excel data import SQL2000 in a table? Thank you for your attention!
Delphi7 how to specify the Excel data import SQL2000 in a table? Thank you for your attention!

Time:10-24

If I am from A table in A database, the data from everywhere and then exported to the B to B in the database! How should I realize!!!!!
PS: I manually in EXCEL to export A table of data field changes into A and B in the table the same, should be how to import!


Thanks for your advice! The couple don't spray!

CodePudding user response:

 select * into b from a 

CodePudding user response:

Write A program to read your good Excel, which is A data in A table, write A loop, with SQL, directly inserted into the database table B B will do

CodePudding user response:

Mssql2000, through SQL scripts can be directly imported XLS data; Lz directly find a ready-made can on the Internet

CodePudding user response:

Excel import SQL method are many, two are common:

1, if your excel file data is stored in the column, and excel import format stored the same way, and the first column of the excel is a field name or directly is data, it can use the
Con1. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; EXCEL 8.0; HDR=Yes; IMEX=1; The Database=D: \ mydb. XLS ';
Open this link statements directly, where HDR=Yes means the first line is the field name, if is the data directly, use HDR=No

2, if the inside of the excel file data is other formats, but regularly, use
CreateOleObject (' EXCEL. APPLICATION);
Such a statement read excel and then written to the database operation,
  • Related