質問するログイン新規登録

質問編集履歴

1

該当ソースの追記

2018/08/15 02:46

投稿

xxx8
xxx8

スコア41

title CHANGED
File without changes
body CHANGED
@@ -31,6 +31,26 @@
31
31
  解決できず、とても困っています。
32
32
  どうぞ、よろしくお願い申し上げます。
33
33
 
34
+ ### 【追記】Jet Provider使用
35
+
36
+ 'CSVファイルのあるフォルダ
37
+ Dim csvDir As String = "C:\test\"
38
+ 'CSVファイルの名前
39
+ Dim csvFileName As String = "test.csv"
40
+
41
+ '接続文字列
42
+ Dim conString As String = _
43
+ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
44
+ + csvDir + ";Extended Properties=""text;HDR=No;FMT=Delimited"""
45
+ Dim con As New System.Data.OleDb.OleDbConnection(conString)
46
+
47
+ Dim commText As String = "SELECT * FROM [" + csvFileName + "]"
48
+ Dim da As New System.Data.OleDb.OleDbDataAdapter(commText, con)
49
+
50
+ 'DataTableに格納する
51
+ Dim dt As New DataTable
52
+ da.Fill(dt)
53
+
34
54
  ### 補足情報(FW/ツールのバージョンなど)
35
55
 
36
56
  Visual Studio 2015