stal
May 23 2012, 01:44 AM
I am doing a simle Auto import of multiple csv files, 2 of the column I import is filled with IP Addresses value.
once I do the import, after checking the table I realize that the entire IP Addresses values are cut, for example
the real value is 192.113.13.80 and in the table I see 192.1131 this applicable for both the column and the entire rows. all other colomn imported correctly.
but, If I do a manual import for one of the files it being imported successfully. what can be the reason of the problem with the IP Address?
here is the code I use:
Dim f As Object '//File Object
With CreateObject("Scripting.FileSystemObject")
For Each f In .GetFolder("D:\Download\Msg\").Files
DoCmd.TransferText acImportDelim, , "Temp", f.Path, True, ""
Next f
End With
Bob G
May 23 2012, 06:10 AM
it may be thinking the column is a number and will only allow one decimal point. What are you using as the delimiter on import? what data type is the field it is going to.
EDIT:
What happens, as a test, if you import the CSV into an Excel file and then import the Excel file into Access ??
gary84
May 24 2012, 07:05 PM
Idea #1: play with the arguments in DoCmd.TransferText acImportDelim, , "Temp", f.Path, True, ""
Idea #2: insert a fake first line in the CSV files, with alphabetic characters, like "aaa.bbb.ccc.ddd", to help discourage the import wizard from interpreting the data as numeric.
Idea #3: post samples of a csv file with your IP address data and I can give you a tailored script that will import them.
stal
May 25 2012, 02:41 AM
Thanks gary
I tried to add a fake first line in the file, however, while import it the IP Values field for this line was blank the rest of the rows remain with the same problem.
anyway, enclose is a sample of a file format.
gary84
May 25 2012, 07:12 AM
It's saying the zip file is invalid.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.