使用OLEDB读取文件 [英] read files using OLEDB
本文介绍了使用OLEDB读取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用 Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c:\; Extended Properties ="=" text; HDR = No; FMT = Delimited''"
我从字段中获取值,但是如果数据为十进制/双精度值,则它们将被截断为整数.如何避免这种情况?你有什么想法?感谢您的任何建议.
When I use Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=""text;HDR=No;FMT=Delimited''"""
I get the values from the fields but if the data is decimal/double they are truncated to integers. How to avoide this? Do you have any ideas? Thanks for any suggestions.
推荐答案
您要从使用OBLDB读取text/csv吗?,
这是文本文件的连接字符串的链接
http://connectionstrings.com/text [ ^ ]
Are you going to read the text/csv from using OBLDB..,
Here is the link for connection string for text files
http://connectionstrings.com/text[^]
can you clear me how you are getting the fields data.. ???
我像这样使用它,并且可以无任何截断地工作.
I use it like this, and it works without any truncation.
Dim da As New OleDbDataAdapter("select * from [x.txt]", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=""text;HDR=No;FMT=Delimited""")
Dim ds As New dataset
da.Fill(ds)
c:\ x.txt
中的内容
---------------------
1,prerak,400,12.50
2,patel,500,12.00
contents in c:\x.txt
---------------------
1,prerak,400,12.50
2,patel,500,12.00
这篇关于使用OLEDB读取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文