質問編集履歴

9

使っているツールのバージョンなど補足情報を追加いたしました。

2021/04/07 07:07

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -130,11 +130,13 @@
130
130
 
131
131
  ACCESSのバージョン2103
132
132
 
133
- VB.netでWindows10の64ビット
133
+ Windows10の64ビット
134
134
 
135
- Visual Studioを使用してます。
135
+ WindowsForms作成
136
136
 
137
+ Visual Studio2019
137
138
 
139
+ NET Framework 4.8を使用してます。
138
140
 
139
141
 
140
142
 

8

ダブルクォートを追加いたします。

2021/04/07 07:07

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  前提・実現したいこと
2
2
 
3
- VB.NETからAccessのデータを取得したいです。
3
+ VB.NETAccessのデータを取得したいです。
4
4
 
5
5
 
6
6
 

7

ダブルクォートを追加いたします。

2021/04/07 06:41

投稿

rarara_123
rarara_123

スコア11

test CHANGED
@@ -1 +1 @@
1
- VB.NETからAccessのデータを取得したいです。
1
+ VB.NETAccessのデータを取得したいです。
test CHANGED
File without changes

6

ダブルクォートを追加いたします。

2021/04/07 06:41

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -7,6 +7,8 @@
7
7
  発生している問題・エラーメッセージ
8
8
 
9
9
  BC30590 イベントLoadが見つかりません。とエラーが表示されます。
10
+
11
+ エラーは二行目「 Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load」の最後のLoadで発生してます。
10
12
 
11
13
 
12
14
 
@@ -126,9 +128,13 @@
126
128
 
127
129
  使っているツールのバージョンなど補足情報
128
130
 
129
- windows10 64ビット
131
+ ACCESSのバージョン2103
130
132
 
131
- ACCESSのバージョン2103
133
+ VB.netでWindows10の64ビット
134
+
135
+ Visual Studioを使用してます。
136
+
137
+
132
138
 
133
139
 
134
140
 

5

ダブルクォートを追加いたします。

2021/04/07 06:23

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -18,211 +18,101 @@
18
18
 
19
19
  Public Class frmConnectAccessDB
20
20
 
21
- ```
22
-
23
- ```
24
-
25
- Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load
21
+ Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load
26
-
27
- ```
28
22
 
29
23
 
30
24
 
31
- 'SQL作成
25
+ 'SQL作成
32
26
 
27
+ Dim resultDt As New DataTable
33
28
 
29
+ Dim sql = New System.Text.StringBuilder()
34
30
 
35
- ```
31
+ sql.AppendLine("SELECT")
36
32
 
37
- Dim resultDt As New DataTable
33
+ sql.AppendLine(" *")
38
34
 
39
- ```
40
-
41
- ```
42
-
43
- Dim sql = New System.Text.StringBuilder()
44
-
45
- ```
46
-
47
- ```
48
-
49
- sql.AppendLine("SELECT")
50
-
51
- ```
52
-
53
- ```
54
-
55
- sql.AppendLine(" *")
56
-
57
- ```
58
-
59
- ```
60
-
61
- sql.AppendLine("FROM ID給料")
35
+ sql.AppendLine("FROM ID給料")
62
-
63
- ```
64
36
 
65
37
 
66
38
 
67
39
  'Access接続準備
68
40
 
69
- ```
41
+ Dim command As New OleDbCommand
70
42
 
71
- Dim command As New OleDbCommand
43
+ Dim da As New OleDbDataAdapter
72
44
 
73
- ```
45
+ Dim cnAccess As OleDbConnection = New OleDbConnection
74
46
 
75
- ```
76
-
77
- Dim da As New OleDbDataAdapter
78
-
79
- ```
80
-
81
- ```
82
-
83
- Dim cnAccess As OleDbConnection = New OleDbConnection
84
-
85
- cnAccess.ConnectionString = My.Settings.アクセス
47
+ cnAccess.ConnectionString = My.Settings.アクセス
86
-
87
- ```
88
48
 
89
49
 
90
50
 
91
51
  'Access接続開始
92
52
 
93
- ```
94
-
95
- cnAccess.Open()
53
+ cnAccess.Open()
96
-
97
- ```
98
-
99
- ```
100
-
101
- Try
102
-
103
- ```
104
-
105
- ```
106
-
107
- command.Connection = cnAccess
108
-
109
- ```
110
-
111
- ```
112
-
113
- command.CommandText = sql.ToString
114
-
115
- ```
116
-
117
- ```
118
-
119
- da.SelectCommand = command
120
-
121
- ```
122
54
 
123
55
 
124
56
 
125
- 'SQL実行 結果をデータテーブルに格納
126
-
127
- ```
128
-
129
- da.Fill(resultDt)
130
-
131
- ```
132
-
133
- ```
134
-
135
- Catch ex As Exception
136
-
137
- ```
138
-
139
- ```
140
-
141
- Throw
57
+ Try
142
-
143
- ```
144
-
145
- ```
146
-
147
- Finally
148
-
149
- ```
150
-
151
- ```
152
-
153
- command.Dispose()
154
-
155
- ```
156
-
157
- ```
158
-
159
- da.Dispose()
160
-
161
- ```
162
-
163
- ```
164
-
165
- cnAccess.Close()
166
-
167
- ```
168
-
169
- ```
170
-
171
- End Try
172
-
173
- ```
174
58
 
175
59
 
176
60
 
61
+ command.Connection = cnAccess
62
+
63
+ command.CommandText = sql.ToString
64
+
177
- 'データテーブルの結果を表示
65
+ da.SelectCommand = command
178
66
 
179
67
 
180
68
 
181
- ```
69
+ 'SQL実行 結果をデータテーブルに格納
182
70
 
183
- For rowindex As Integer = 0 To resultDt.Rows.Count - 1
71
+ da.Fill(resultDt)
184
72
 
185
- ```
186
73
 
187
- ```
188
74
 
189
- For colindex As Integer = 0 To resultDt.Columns.Count - 1
190
75
 
191
- ```
192
76
 
193
- ```
77
+ Catch ex As Exception
194
78
 
195
- Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")
79
+ Throw
196
80
 
197
- ```
81
+ Finally
198
82
 
199
- ```
83
+ command.Dispose()
200
84
 
201
- Next
85
+ da.Dispose()
202
86
 
203
- ```
87
+ cnAccess.Close()
204
88
 
205
- ```
89
+ End Try
206
90
 
207
- Console.WriteLine()
208
91
 
209
- ```
210
92
 
211
- ```
93
+ 'データテーブルの結果を表示
212
94
 
213
- Next
95
+ For rowindex As Integer = 0 To resultDt.Rows.Count - 1
214
96
 
215
- ```
97
+ For colindex As Integer = 0 To resultDt.Columns.Count - 1
216
98
 
217
- ```
99
+ Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")
218
100
 
219
- End Sub
101
+ Next
220
102
 
221
- ```
103
+ Console.WriteLine()
222
104
 
223
- ```
105
+ Next
224
106
 
107
+
108
+
109
+ End Sub
110
+
225
- End Class
111
+ End Class
112
+
113
+
114
+
115
+
226
116
 
227
117
  ```
228
118
 

4

ダブルクォートを追加いたします。

2021/04/07 06:20

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -14,99 +14,217 @@
14
14
 
15
15
 
16
16
 
17
+ ```
18
+
17
- ```Public Class frmConnectAccessDB```
19
+ Public Class frmConnectAccessDB
20
+
18
-
21
+ ```
22
+
23
+ ```
24
+
19
- ```Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load```
25
+ Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load
26
+
20
-
27
+ ```
21
-
22
-
28
+
29
+
30
+
23
- 'SQL作成
31
+ 'SQL作成
32
+
33
+
34
+
24
-
35
+ ```
36
+
25
- ```Dim resultDt As New DataTable```
37
+ Dim resultDt As New DataTable
38
+
26
-
39
+ ```
40
+
41
+ ```
42
+
27
- ```Dim sql = New System.Text.StringBuilder()```
43
+ Dim sql = New System.Text.StringBuilder()
44
+
28
-
45
+ ```
46
+
47
+ ```
48
+
29
- ```sql.AppendLine("SELECT")```
49
+ sql.AppendLine("SELECT")
50
+
30
-
51
+ ```
52
+
53
+ ```
54
+
31
- ```sql.AppendLine(" *")```
55
+ sql.AppendLine(" *")
56
+
32
-
57
+ ```
58
+
59
+ ```
60
+
33
- ```sql.AppendLine("FROM ID給料")```
61
+ sql.AppendLine("FROM ID給料")
62
+
63
+ ```
34
64
 
35
65
 
36
66
 
37
67
  'Access接続準備
38
68
 
69
+ ```
70
+
39
- ```Dim command As New OleDbCommand```
71
+ Dim command As New OleDbCommand
72
+
40
-
73
+ ```
74
+
75
+ ```
76
+
41
- ```Dim da As New OleDbDataAdapter```
77
+ Dim da As New OleDbDataAdapter
78
+
42
-
79
+ ```
80
+
81
+ ```
82
+
43
- ```Dim cnAccess As OleDbConnection = New OleDbConnection```
83
+ Dim cnAccess As OleDbConnection = New OleDbConnection
44
-
84
+
45
- cnAccess.ConnectionString = My.Settings.アクセス```
85
+ cnAccess.ConnectionString = My.Settings.アクセス
86
+
87
+ ```
46
88
 
47
89
 
48
90
 
49
91
  'Access接続開始
50
92
 
51
- ```cnAccess.Open()```
52
-
53
-
54
-
55
- ```Try```
56
-
57
-
58
-
59
- ```command.Connection = cnAccess```
60
-
61
- ```command.CommandText = sql.ToString```
62
-
63
- ```da.SelectCommand = command```
64
-
65
-
66
-
67
- 'SQL実行 結果をデータテーブルに格納
68
-
69
- ```da.Fill(resultDt)```
70
-
71
-
72
-
73
-
74
-
75
- ```Catch ex As Exception```
76
-
77
- ```Throw```
78
-
79
- ```Finally
80
-
81
- command.Dispose()
82
-
83
- da.Dispose()
84
-
85
- cnAccess.Close()```
86
-
87
- ```End Try```
88
-
89
-
90
-
91
- 'データテーブルの結果を表示
92
-
93
- ```For rowindex As Integer = 0 To resultDt.Rows.Count - 1```
94
-
95
- ```For colindex As Integer = 0 To resultDt.Columns.Count - 1```
96
-
97
- ```Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")```
98
-
99
- ```Next```
100
-
101
- ```Console.WriteLine()```
102
-
103
- ```Next```
104
-
105
-
106
-
107
- ```End Sub```
108
-
109
- ```End Class```
93
+ ```
94
+
95
+ cnAccess.Open()
96
+
97
+ ```
98
+
99
+ ```
100
+
101
+ Try
102
+
103
+ ```
104
+
105
+ ```
106
+
107
+ command.Connection = cnAccess
108
+
109
+ ```
110
+
111
+ ```
112
+
113
+ command.CommandText = sql.ToString
114
+
115
+ ```
116
+
117
+ ```
118
+
119
+ da.SelectCommand = command
120
+
121
+ ```
122
+
123
+
124
+
125
+ 'SQL実行 結果をデータテーブルに格納
126
+
127
+ ```
128
+
129
+ da.Fill(resultDt)
130
+
131
+ ```
132
+
133
+ ```
134
+
135
+ Catch ex As Exception
136
+
137
+ ```
138
+
139
+ ```
140
+
141
+ Throw
142
+
143
+ ```
144
+
145
+ ```
146
+
147
+ Finally
148
+
149
+ ```
150
+
151
+ ```
152
+
153
+ command.Dispose()
154
+
155
+ ```
156
+
157
+ ```
158
+
159
+ da.Dispose()
160
+
161
+ ```
162
+
163
+ ```
164
+
165
+ cnAccess.Close()
166
+
167
+ ```
168
+
169
+ ```
170
+
171
+ End Try
172
+
173
+ ```
174
+
175
+
176
+
177
+ 'データテーブルの結果を表示
178
+
179
+
180
+
181
+ ```
182
+
183
+ For rowindex As Integer = 0 To resultDt.Rows.Count - 1
184
+
185
+ ```
186
+
187
+ ```
188
+
189
+ For colindex As Integer = 0 To resultDt.Columns.Count - 1
190
+
191
+ ```
192
+
193
+ ```
194
+
195
+ Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")
196
+
197
+ ```
198
+
199
+ ```
200
+
201
+ Next
202
+
203
+ ```
204
+
205
+ ```
206
+
207
+ Console.WriteLine()
208
+
209
+ ```
210
+
211
+ ```
212
+
213
+ Next
214
+
215
+ ```
216
+
217
+ ```
218
+
219
+ End Sub
220
+
221
+ ```
222
+
223
+ ```
224
+
225
+ End Class
226
+
227
+ ```
110
228
 
111
229
 
112
230
 

3

ダブルクォートを追加いたします。

2021/04/07 06:07

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -12,101 +12,101 @@
12
12
 
13
13
  該当のソースコード
14
14
 
15
- ```Public Class frmConnectAccessDB
16
15
 
16
+
17
+ ```Public Class frmConnectAccessDB```
18
+
17
- Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load
19
+ ```Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load```
18
20
 
19
21
 
20
22
 
21
23
  'SQL作成
22
24
 
23
- Dim resultDt As New DataTable
25
+ ```Dim resultDt As New DataTable```
24
26
 
25
- Dim sql = New System.Text.StringBuilder()
27
+ ```Dim sql = New System.Text.StringBuilder()```
26
28
 
27
- sql.AppendLine("SELECT")
29
+ ```sql.AppendLine("SELECT")```
28
30
 
29
- sql.AppendLine(" *")
31
+ ```sql.AppendLine(" *")```
30
32
 
31
- sql.AppendLine("FROM ID給料")
33
+ ```sql.AppendLine("FROM ID給料")```
32
34
 
33
35
 
34
36
 
35
37
  'Access接続準備
36
38
 
37
- Dim command As New OleDbCommand
39
+ ```Dim command As New OleDbCommand```
38
40
 
39
- Dim da As New OleDbDataAdapter
41
+ ```Dim da As New OleDbDataAdapter```
40
42
 
41
- Dim cnAccess As OleDbConnection = New OleDbConnection
43
+ ```Dim cnAccess As OleDbConnection = New OleDbConnection```
42
44
 
43
- cnAccess.ConnectionString = My.Settings.アクセス
45
+ cnAccess.ConnectionString = My.Settings.アクセス```
44
46
 
45
47
 
46
48
 
47
49
  'Access接続開始
48
50
 
49
- cnAccess.Open()
51
+ ```cnAccess.Open()```
50
52
 
51
53
 
52
54
 
53
- Try
55
+ ```Try```
54
56
 
55
57
 
56
58
 
57
- command.Connection = cnAccess
59
+ ```command.Connection = cnAccess```
58
60
 
59
- command.CommandText = sql.ToString
61
+ ```command.CommandText = sql.ToString```
60
62
 
61
- da.SelectCommand = command
63
+ ```da.SelectCommand = command```
62
64
 
63
65
 
64
66
 
65
67
  'SQL実行 結果をデータテーブルに格納
66
68
 
67
- da.Fill(resultDt)
69
+ ```da.Fill(resultDt)```
68
70
 
69
71
 
70
72
 
71
73
 
72
74
 
73
- Catch ex As Exception
75
+ ```Catch ex As Exception```
74
76
 
75
- Throw
77
+ ```Throw```
76
78
 
77
- Finally
79
+ ```Finally
78
80
 
79
81
  command.Dispose()
80
82
 
81
83
  da.Dispose()
82
84
 
83
- cnAccess.Close()
85
+ cnAccess.Close()```
84
86
 
85
- End Try
87
+ ```End Try```
86
88
 
87
89
 
88
90
 
89
91
  'データテーブルの結果を表示
90
92
 
91
- For rowindex As Integer = 0 To resultDt.Rows.Count - 1
93
+ ```For rowindex As Integer = 0 To resultDt.Rows.Count - 1```
92
94
 
93
- For colindex As Integer = 0 To resultDt.Columns.Count - 1
95
+ ```For colindex As Integer = 0 To resultDt.Columns.Count - 1```
94
96
 
95
- Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")
97
+ ```Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")```
96
98
 
97
- Next
99
+ ```Next```
98
100
 
99
- Console.WriteLine()
101
+ ```Console.WriteLine()```
100
102
 
101
- Next
103
+ ```Next```
102
104
 
103
105
 
104
106
 
105
- End Sub
107
+ ```End Sub```
106
108
 
107
- End Class```
109
+ ```End Class```
108
-
109
-
110
110
 
111
111
 
112
112
 

2

ダブルクォートを追加いたします。

2021/04/07 05:46

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -12,99 +12,101 @@
12
12
 
13
13
  該当のソースコード
14
14
 
15
- ```Public Class frmConnectAccessDB```
15
+ ```Public Class frmConnectAccessDB
16
16
 
17
- ```Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load```
17
+ Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load
18
18
 
19
19
 
20
20
 
21
21
  'SQL作成
22
22
 
23
- ```Dim resultDt As New DataTable```
23
+ Dim resultDt As New DataTable
24
24
 
25
- ```Dim sql = New System.Text.StringBuilder()```
25
+ Dim sql = New System.Text.StringBuilder()
26
26
 
27
- ```sql.AppendLine("SELECT")```
27
+ sql.AppendLine("SELECT")
28
28
 
29
- ```sql.AppendLine(" *")```
29
+ sql.AppendLine(" *")
30
30
 
31
- ```sql.AppendLine("FROM ID給料")```
31
+ sql.AppendLine("FROM ID給料")
32
32
 
33
33
 
34
34
 
35
35
  'Access接続準備
36
36
 
37
- ```Dim command As New OleDbCommand```
37
+ Dim command As New OleDbCommand
38
38
 
39
- ```Dim da As New OleDbDataAdapter```
39
+ Dim da As New OleDbDataAdapter
40
40
 
41
- ```Dim cnAccess As OleDbConnection = New OleDbConnection
41
+ Dim cnAccess As OleDbConnection = New OleDbConnection
42
42
 
43
- cnAccess.ConnectionString = My.Settings.アクセス```
43
+ cnAccess.ConnectionString = My.Settings.アクセス
44
44
 
45
45
 
46
46
 
47
47
  'Access接続開始
48
48
 
49
- ```cnAccess.Open()```
49
+ cnAccess.Open()
50
50
 
51
51
 
52
52
 
53
- ```Try```
53
+ Try
54
54
 
55
55
 
56
56
 
57
- ```command.Connection = cnAccess```
57
+ command.Connection = cnAccess
58
58
 
59
- ```command.CommandText = sql.ToString```
59
+ command.CommandText = sql.ToString
60
60
 
61
- ```da.SelectCommand = command```
61
+ da.SelectCommand = command
62
62
 
63
63
 
64
64
 
65
65
  'SQL実行 結果をデータテーブルに格納
66
66
 
67
- ```da.Fill(resultDt)```
67
+ da.Fill(resultDt)
68
68
 
69
69
 
70
70
 
71
71
 
72
72
 
73
- ```Catch ex As Exception```
73
+ Catch ex As Exception
74
74
 
75
- ```Throw```
75
+ Throw
76
76
 
77
- ```Finally```
77
+ Finally
78
78
 
79
- ```command.Dispose()```
79
+ command.Dispose()
80
80
 
81
- ```da.Dispose()```
81
+ da.Dispose()
82
82
 
83
- ```cnAccess.Close()```
83
+ cnAccess.Close()
84
84
 
85
- ```End Try```
85
+ End Try
86
86
 
87
87
 
88
88
 
89
89
  'データテーブルの結果を表示
90
90
 
91
- ```For rowindex As Integer = 0 To resultDt.Rows.Count - 1```
91
+ For rowindex As Integer = 0 To resultDt.Rows.Count - 1
92
92
 
93
- ```For colindex As Integer = 0 To resultDt.Columns.Count - 1```
93
+ For colindex As Integer = 0 To resultDt.Columns.Count - 1
94
94
 
95
- ```Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")```
95
+ Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")
96
96
 
97
- ```Next```
97
+ Next
98
98
 
99
- ```Console.WriteLine()```
99
+ Console.WriteLine()
100
100
 
101
- ```Next```
101
+ Next
102
102
 
103
103
 
104
104
 
105
- ```End Sub```
105
+ End Sub
106
106
 
107
- ```End Class```
107
+ End Class```
108
+
109
+
108
110
 
109
111
 
110
112
 

1

コードにバッククォートを追加いたしました。

2021/04/07 05:40

投稿

rarara_123
rarara_123

スコア11

test CHANGED
File without changes
test CHANGED
@@ -12,99 +12,99 @@
12
12
 
13
13
  該当のソースコード
14
14
 
15
- Public Class frmConnectAccessDB
15
+ ```Public Class frmConnectAccessDB```
16
16
 
17
- Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load
17
+ ```Private Sub frmConnectAccessDB_Load(sender As Object, e As EventArgs) Handles MyBase.Load```
18
18
 
19
19
 
20
20
 
21
21
  'SQL作成
22
22
 
23
- Dim resultDt As New DataTable
23
+ ```Dim resultDt As New DataTable```
24
24
 
25
- Dim sql = New System.Text.StringBuilder()
25
+ ```Dim sql = New System.Text.StringBuilder()```
26
26
 
27
- sql.AppendLine("SELECT")
27
+ ```sql.AppendLine("SELECT")```
28
28
 
29
- sql.AppendLine(" *")
29
+ ```sql.AppendLine(" *")```
30
30
 
31
- sql.AppendLine("FROM ID給料")
31
+ ```sql.AppendLine("FROM ID給料")```
32
32
 
33
33
 
34
34
 
35
35
  'Access接続準備
36
36
 
37
- Dim command As New OleDbCommand
37
+ ```Dim command As New OleDbCommand```
38
38
 
39
- Dim da As New OleDbDataAdapter
39
+ ```Dim da As New OleDbDataAdapter```
40
40
 
41
- Dim cnAccess As OleDbConnection = New OleDbConnection
41
+ ```Dim cnAccess As OleDbConnection = New OleDbConnection
42
42
 
43
- cnAccess.ConnectionString = My.Settings.アクセス
43
+ cnAccess.ConnectionString = My.Settings.アクセス```
44
44
 
45
45
 
46
46
 
47
47
  'Access接続開始
48
48
 
49
- cnAccess.Open()
49
+ ```cnAccess.Open()```
50
50
 
51
51
 
52
52
 
53
- Try
53
+ ```Try```
54
54
 
55
55
 
56
56
 
57
- command.Connection = cnAccess
57
+ ```command.Connection = cnAccess```
58
58
 
59
- command.CommandText = sql.ToString
59
+ ```command.CommandText = sql.ToString```
60
60
 
61
- da.SelectCommand = command
61
+ ```da.SelectCommand = command```
62
62
 
63
63
 
64
64
 
65
65
  'SQL実行 結果をデータテーブルに格納
66
66
 
67
- da.Fill(resultDt)
67
+ ```da.Fill(resultDt)```
68
68
 
69
69
 
70
70
 
71
71
 
72
72
 
73
- Catch ex As Exception
73
+ ```Catch ex As Exception```
74
74
 
75
- Throw
75
+ ```Throw```
76
76
 
77
- Finally
77
+ ```Finally```
78
78
 
79
- command.Dispose()
79
+ ```command.Dispose()```
80
80
 
81
- da.Dispose()
81
+ ```da.Dispose()```
82
82
 
83
- cnAccess.Close()
83
+ ```cnAccess.Close()```
84
84
 
85
- End Try
85
+ ```End Try```
86
86
 
87
87
 
88
88
 
89
89
  'データテーブルの結果を表示
90
90
 
91
- For rowindex As Integer = 0 To resultDt.Rows.Count - 1
91
+ ```For rowindex As Integer = 0 To resultDt.Rows.Count - 1```
92
92
 
93
- For colindex As Integer = 0 To resultDt.Columns.Count - 1
93
+ ```For colindex As Integer = 0 To resultDt.Columns.Count - 1```
94
94
 
95
- Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")
95
+ ```Console.Write(resultDt.Rows(rowindex).Item(colindex).ToString & " ")```
96
96
 
97
- Next
97
+ ```Next```
98
98
 
99
- Console.WriteLine()
99
+ ```Console.WriteLine()```
100
100
 
101
- Next
101
+ ```Next```
102
102
 
103
103
 
104
104
 
105
- End Sub
105
+ ```End Sub```
106
106
 
107
- End Class
107
+ ```End Class```
108
108
 
109
109
 
110
110