EDN Admin
Well-known member
Hi Team
Hope you all are well.
I really need to find the solution to this problem.
When I import a csv file containing alpha numeric data in text field (e.g J12345) it ignores the J in the begining a only imports 12345.
I have done all the tricks such as sorting all the text data in the begining etc. In this instance they all are same and it ignores first alpha. HOW BIZZARE !!!!
For test purposes I put the first field to be wholely Text such as "TEST" and it even ignored that and import it as blank.
please please guys. ENLIGHTEN ME !!!
Much appreciate your help.
Kind regards
Sap
PS: I used below code to import the file. (Courtesy goes to http://social.msdn.microsoft.com/profile/paul%20p%20clement%20iv/?type=forum&referrer=http://social.msdn.microsoft.com/Forums/en-US/user/threads?user=SapHelp " title="About Paul P Clement IV
<span>Paul P Clement IV )
<pre class="prettyprint lang-vb AccessConn.Open()
Dim AccessCommand As _
New System.Data.OleDb.OleDbCommand("INSERT INTO [ImportTable] SELECT * FROM [Text;DATABASE=" & System.IO.Path.GetDirectoryName(OpenFileDialog.FileName) & ";HDR=Yes].[" & _
OpenFileDialog.SafeFileName & "]", AccessConn)
AccessCommand.ExecuteNonQuery()
AccessConn.Close()[/code]
<br/>
<br/>
View the full article
Hope you all are well.
I really need to find the solution to this problem.
When I import a csv file containing alpha numeric data in text field (e.g J12345) it ignores the J in the begining a only imports 12345.
I have done all the tricks such as sorting all the text data in the begining etc. In this instance they all are same and it ignores first alpha. HOW BIZZARE !!!!
For test purposes I put the first field to be wholely Text such as "TEST" and it even ignored that and import it as blank.
please please guys. ENLIGHTEN ME !!!
Much appreciate your help.
Kind regards
Sap
PS: I used below code to import the file. (Courtesy goes to http://social.msdn.microsoft.com/profile/paul%20p%20clement%20iv/?type=forum&referrer=http://social.msdn.microsoft.com/Forums/en-US/user/threads?user=SapHelp " title="About Paul P Clement IV
<span>Paul P Clement IV )
<pre class="prettyprint lang-vb AccessConn.Open()
Dim AccessCommand As _
New System.Data.OleDb.OleDbCommand("INSERT INTO [ImportTable] SELECT * FROM [Text;DATABASE=" & System.IO.Path.GetDirectoryName(OpenFileDialog.FileName) & ";HDR=Yes].[" & _
OpenFileDialog.SafeFileName & "]", AccessConn)
AccessCommand.ExecuteNonQuery()
AccessConn.Close()[/code]
<br/>
<br/>
View the full article