Hello All,
Looks like an EXCEL day on the board.
I have a successful DAO EXCEL import operation.
A customer used to send their EXCEL information in one large .XLS, now they send the information in 3-6 smaller .XLS files. I would like to just import each smaller XLS file. Trying to keep prep work down on the XLS files.
After the first import with the DAO, it locks the import XLS file. I would like to use the same name for the 3-6 import files, so I can use the same import operation.
How can I break the link to the EXCEL file with ALPHA still running? Right now I have to shut down ALPHA and then restart ALPHA. So that I can overwright the import XLS file with the same name(all 6 files need to be named the same).
Am I looking at this wrong?
Here is the import code:
Thanks in advance
Ed
Looks like an EXCEL day on the board.
I have a successful DAO EXCEL import operation.
A customer used to send their EXCEL information in one large .XLS, now they send the information in 3-6 smaller .XLS files. I would like to just import each smaller XLS file. Trying to keep prep work down on the XLS files.
After the first import with the DAO, it locks the import XLS file. I would like to use the same name for the 3-6 import files, so I can use the same import operation.
How can I break the link to the EXCEL file with ALPHA still running? Right now I have to shut down ALPHA and then restart ALPHA. So that I can overwright the import XLS file with the same name(all 6 files need to be named the same).
Am I looking at this wrong?
Here is the import code:
HTML Code:
dim connectionString as c connectionString = "{A5API='Excel',A5Syntax='Excel',FileName='C:\alphaimport\hsimport.xls'}" delete options dim options as p options.ConsolidateArguments= .t. options.AddTablesToDatabase= .f. options.ShowProgress= .t. options.AllowCancel= .t. delete a_import dim a_import[0] as p a_import[].ObjectName = "Sheet1$" a_import[..].SQLSelectStatement = "SELECT PCode, [Roll Number], BWt, Width, Diameter, [Gross Wt], CUSTOMER FROM [Sheet1$]" a_import[..].SQLType = "Portable" a_import[..].Arguments = "" a_import[..].ImportType = "Append to existing table" a_import[..].AppendOption = "Append all" a_import[..].AppendToTableName = a5.get_path() + chr(92) + "hs_xls_imp"+".dbf" a_import[..].AppendFieldMap = <<%txt% Customer|Customer Pcode|Pcode Roll_number|Roll_number Bwt|Bwt Width|Width Diameter|Diameter Gross_wt|Gross_wt %txt% dim flagSilent as l delete args dim args as sql::arguments flagSilent = .f. delete p dim p as p p = a5_AlphaDAO_Import(connectionString,a_import,options,flagSilent,args) 'p has an .hasError and .errorText property 'a_import[] has the following properties for each item: .countRecordsImported, .hasError, .errorText, .userCancelled
Ed
Comment