質問編集履歴

1

該当ソースの追記

2018/08/15 02:46

投稿

xxx8
xxx8

スコア41

test CHANGED
File without changes
test CHANGED
@@ -64,6 +64,46 @@
64
64
 
65
65
 
66
66
 
67
+ ### 【追記】Jet Provider使用
68
+
69
+
70
+
71
+ 'CSVファイルのあるフォルダ
72
+
73
+ Dim csvDir As String = "C:\test\"
74
+
75
+ 'CSVファイルの名前
76
+
77
+ Dim csvFileName As String = "test.csv"
78
+
79
+
80
+
81
+ '接続文字列
82
+
83
+ Dim conString As String = _
84
+
85
+ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
86
+
87
+ + csvDir + ";Extended Properties=""text;HDR=No;FMT=Delimited"""
88
+
89
+ Dim con As New System.Data.OleDb.OleDbConnection(conString)
90
+
91
+
92
+
93
+ Dim commText As String = "SELECT * FROM [" + csvFileName + "]"
94
+
95
+ Dim da As New System.Data.OleDb.OleDbDataAdapter(commText, con)
96
+
97
+
98
+
99
+ 'DataTableに格納する
100
+
101
+ Dim dt As New DataTable
102
+
103
+ da.Fill(dt)
104
+
105
+
106
+
67
107
  ### 補足情報(FW/ツールのバージョンなど)
68
108
 
69
109