UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Importing An Ip Address From .csv, Access 2016    
 
   
kgerlitz
post Dec 8 2017, 05:14 PM
Post#1



Posts: 305
Joined: 13-May 06
From: IA


I have an OnClick event that imports data from a .csv into fields in a table. Everything works great except for an IP Address field. in the .csv file it shows correctly 192.168.1.234. However, after the import, the field (formatted as short text) in the access table shows 192.1681 What am I missing here??

--------------------
Totally, Completely, Utterly Confused
Go to the top of the page
 
John Vinson
post Dec 8 2017, 08:09 PM
Post#2


UtterAccess VIP
Posts: 4,146
Joined: 6-January 07
From: Parma, Idaho, US


Since a .csv file (or an Excel spreadsheet, for that matter) has no datatypes, Access must guess the appropriate datatype based on the first few records. Since 192.168 could plausibly be interpreted as a decimal number, it appears that the program is making that (wrong) guess.

You should be able to use an Import Specification to explicitly define this field as being of Text datatype.

--------------------
John W. Vinson
Wysard of Information
Go to the top of the page
 
HairyBob
post Dec 9 2017, 08:03 AM
Post#3



Posts: 881
Joined: 26-March 08
From: London


In addition to John's suggestion, you can insert a dummy 1st data row in your csv file which has a text value in every column (i.e. values that can only be interpreted as text). Once you've imported the data, you then delete the dummy row before doing whatever you want with the data.

HTH...

Hairy.

--------------------
If it was easy, It wouldn't be fun!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th December 2017 - 05:18 PM