Hi,
I am importing data from a user selected Excel file via AlphaDAO
On my development machine it creates the following data types when importing the data to the dbf file:
1. chr
2. exponentnumeric
3. exponentnumeric
3. chr
4. chr
Based on the above settings, everything is working fine.
When I test the exact same thing on 2 other machines with the same excel file the data types created in the dbf files are:
1. chr
2. chr
3. chr
3. chr
4. chr
causing a "field and expression types must match error" when starting the append operations.
I have tried to overwrite the data type settings in the "local table field defenition" on the AlphaDAO settings, also no luck.
I have also tried to change the data type in the excel file with this code - also not working:
Is there another way I can make sure the imported data from the Excel files are either all chr fields, or the field types as mentioned at the beginning.
I really need a consistent import operation, as the user are importing loads of excel files daily - all the same format.
Any ideas please?
Walter
I am importing data from a user selected Excel file via AlphaDAO
On my development machine it creates the following data types when importing the data to the dbf file:
1. chr
2. exponentnumeric
3. exponentnumeric
3. chr
4. chr
Based on the above settings, everything is working fine.
When I test the exact same thing on 2 other machines with the same excel file the data types created in the dbf files are:
1. chr
2. chr
3. chr
3. chr
4. chr
causing a "field and expression types must match error" when starting the append operations.
I have tried to overwrite the data type settings in the "local table field defenition" on the AlphaDAO settings, also no luck.
I have also tried to change the data type in the excel file with this code - also not working:
Code:
Dim xlApp as p xlApp = ole.create("Excel.Application") xlApp.Workbooks.Open(vFileName) xlApp.Columns("A:I").Select() xlApp.Selection.NumberFormat = "@" xlapp.DisplayAlerts = .F. ' XL will not display warning regarding overwriting file xlApp.ActiveWorkbook.SaveAs(vFileName) xlApp.Workbooks.Close() xlapp.DisplayAlerts = .T. xlApp.Quit()
I really need a consistent import operation, as the user are importing loads of excel files daily - all the same format.
Any ideas please?
Walter
Comment