Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am creating a utility in which reading data from text file and iinserting in access table

Following is the actual data in text file
Col1,Col2,Col3,Col4,Col5,
10317288,,A,00000000,00000000,
10601329,,A,20120424,20121031,
02573A7B3F1,,A,20060518,99991231,
0434C129E41,,A,20060331,99991231,


But after imported in ms acess getiing only col1 numeric values
Col1	Col2	Col3	Col4	Col5
10317288		A	0	0
10601329		A	20120424	20121031
		A	20060518	99991231
		A	20060331	99991231


Connection String is as follow
C#
String ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dbPath;


And insert query is as follow.
C#
DataTable dtTblQry = openAccessDB("delete from " + strTblName);
                strSql = "insert into " + strTblName + " select " + strFields + " from ";
                strSql += "[Text;IMEX=1;HDR=YES;DATABASE=" + System.Windows.Forms.Application.StartupPath + "\\DATA\\" + ";]";
                strSql += ".";
                strSql += "[" + strTblName + ".txt]";
                dtTblQry = openAccessDB(strSql);


Please help me to resolve this issue!!
Thanks in Advance
Posted
Updated 18-Oct-12 8:44am
v2

1 solution

Question is unclear since it appears from the formatted (poorly) database results that there is in fact more than one number.

However I do note that the two missing values are not "numeric" values.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900