質問編集履歴
9
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -202,178 +202,14 @@
|
|
202
202
|
|
203
203
|
FINAL:
|
204
204
|
|
205
|
-
|
205
|
+
'ファイナル処理
|
206
|
+
|
207
|
+
On Error Resume Next
|
208
|
+
|
209
|
+
Set rs = Nothing
|
210
|
+
|
211
|
+
Set con = Nothing
|
212
|
+
|
213
|
+
End Sub
|
206
214
|
|
207
215
|
```
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
```vba
|
212
|
-
|
213
|
-
<sheet1>
|
214
|
-
|
215
|
-
Option Explicit
|
216
|
-
|
217
|
-
Private Sub CommandButton1_Click()
|
218
|
-
|
219
|
-
UserForm1.Show
|
220
|
-
|
221
|
-
End Sub
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
<UserForm1> テキストボックスとコマンドボタンだけ
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
Option Explicit
|
230
|
-
|
231
|
-
Private Sub CommandButton1_Click() 'ボタンを押すと
|
232
|
-
|
233
|
-
On Error GoTo ERROR
|
234
|
-
|
235
|
-
Dim con As New ADODB.Connection
|
236
|
-
|
237
|
-
Dim rs As New ADODB.Recordset
|
238
|
-
|
239
|
-
Dim cmd As New ADODB.Command
|
240
|
-
|
241
|
-
Dim param As New ADODB.Parameter
|
242
|
-
|
243
|
-
Dim ds As String 'データソース定義
|
244
|
-
|
245
|
-
Dim user As String 'ユーザ名
|
246
|
-
|
247
|
-
Dim pass As String 'パスワード
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
ds = "Provider=OraOLEDB.oracle;"
|
252
|
-
|
253
|
-
ds = ds & "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.5)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XEPDB1)));"
|
254
|
-
|
255
|
-
ds = ds & "User ID=HTS;Password=htshts"
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
con.ConnectionString = ds
|
260
|
-
|
261
|
-
con.Open
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
cmd.ActiveConnection = con
|
266
|
-
|
267
|
-
cmd.CommandTimeout = 0
|
268
|
-
|
269
|
-
cmd.CommandType = adCmdText
|
270
|
-
|
271
|
-
cmd.CommandText = "select DJNAME ? from EDM"
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
Set param = cmd.CreateParameter("DJNAME", adVarChar, adParamInput, 20)
|
276
|
-
|
277
|
-
cmd.Parameters.Append param
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
cmd.Parameters("DJNAME").Value = "Avicii I'm Test"
|
282
|
-
|
283
|
-
rs.CursorLocation = adUseClient
|
284
|
-
|
285
|
-
rs.CursorType = adOpenStatic
|
286
|
-
|
287
|
-
TextBox1.Value = printSql(cmd) 'TextBox1に値を入れる
|
288
|
-
|
289
|
-
rs.Open cmd
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
GoTo FINAL
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
ERROR:
|
298
|
-
|
299
|
-
MsgBox Erl() & "行目:" & ERROR(Err())
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
FINAL:
|
304
|
-
|
305
|
-
'ファイナル処理
|
306
|
-
|
307
|
-
On Error Resume Next
|
308
|
-
|
309
|
-
Set rs = Nothing
|
310
|
-
|
311
|
-
Set con = Nothing
|
312
|
-
|
313
|
-
End Sub
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
'printSqlの処理として
|
320
|
-
|
321
|
-
Public Function printSql(ByRef cmd As ADODB.Command) As String
|
322
|
-
|
323
|
-
Dim p As ADODB.Parameter
|
324
|
-
|
325
|
-
Dim vntP As Variant
|
326
|
-
|
327
|
-
Dim inti As Integer
|
328
|
-
|
329
|
-
Dim strR As String
|
330
|
-
|
331
|
-
inti = 1
|
332
|
-
|
333
|
-
ReDim vntP(cmd.Parameters.Count)
|
334
|
-
|
335
|
-
For Each p In cmd.Parameters
|
336
|
-
|
337
|
-
Select Case p.Type
|
338
|
-
|
339
|
-
'ここはニーズに応じてタイプを追加してください
|
340
|
-
|
341
|
-
Case adInteger
|
342
|
-
|
343
|
-
vntP(inti) = p.Value
|
344
|
-
|
345
|
-
Case Else
|
346
|
-
|
347
|
-
vntP(inti) = "'" & p.Value & "'"
|
348
|
-
|
349
|
-
End Select
|
350
|
-
|
351
|
-
inti = inti + 1
|
352
|
-
|
353
|
-
Next
|
354
|
-
|
355
|
-
strR = cmd.CommandText
|
356
|
-
|
357
|
-
For inti = 1 To UBound(vntP)
|
358
|
-
|
359
|
-
strR = Replace(strR, "?", vntP(inti), 1, 1)
|
360
|
-
|
361
|
-
Next
|
362
|
-
|
363
|
-
printSql = strR
|
364
|
-
|
365
|
-
End Function
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
Private Sub UserForm_Click()
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
End Sub
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
```
|
8
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -200,7 +200,17 @@
|
|
200
200
|
|
201
201
|
|
202
202
|
|
203
|
+
FINAL:
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
```
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
```vba
|
212
|
+
|
203
|
-
|
213
|
+
<sheet1>
|
204
214
|
|
205
215
|
Option Explicit
|
206
216
|
|
@@ -366,28 +376,4 @@
|
|
366
376
|
|
367
377
|
|
368
378
|
|
369
|
-
'ファイナル処理
|
370
|
-
|
371
|
-
On Error Resume Next
|
372
|
-
|
373
|
-
Set rs = Nothing
|
374
|
-
|
375
|
-
Set con = Nothing
|
376
|
-
|
377
|
-
End Sub
|
378
|
-
|
379
|
-
|
380
|
-
|
381
379
|
```
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
``````test
|
386
|
-
|
387
|
-
ここに言語を入力
|
388
|
-
|
389
|
-
```
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
```
|
7
改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
シングルコーテーションを文字として扱う場合、SQL文のため、テキストボックスからデータを入力する際は
|
30
30
|
|
31
|
-
A,B''cde,C,D,Eとなります。2つつける必要があるからです。
|
31
|
+
A,B''cde,C,D,Eとなります。2つつける必要があるからです。
|
32
32
|
|
33
33
|
これで、データベースには
|
34
34
|
|
@@ -200,6 +200,96 @@
|
|
200
200
|
|
201
201
|
|
202
202
|
|
203
|
+
FINAL:<sheet1>
|
204
|
+
|
205
|
+
Option Explicit
|
206
|
+
|
207
|
+
Private Sub CommandButton1_Click()
|
208
|
+
|
209
|
+
UserForm1.Show
|
210
|
+
|
211
|
+
End Sub
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<UserForm1> テキストボックスとコマンドボタンだけ
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
Option Explicit
|
220
|
+
|
221
|
+
Private Sub CommandButton1_Click() 'ボタンを押すと
|
222
|
+
|
223
|
+
On Error GoTo ERROR
|
224
|
+
|
225
|
+
Dim con As New ADODB.Connection
|
226
|
+
|
227
|
+
Dim rs As New ADODB.Recordset
|
228
|
+
|
229
|
+
Dim cmd As New ADODB.Command
|
230
|
+
|
231
|
+
Dim param As New ADODB.Parameter
|
232
|
+
|
233
|
+
Dim ds As String 'データソース定義
|
234
|
+
|
235
|
+
Dim user As String 'ユーザ名
|
236
|
+
|
237
|
+
Dim pass As String 'パスワード
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
ds = "Provider=OraOLEDB.oracle;"
|
242
|
+
|
243
|
+
ds = ds & "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.5)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XEPDB1)));"
|
244
|
+
|
245
|
+
ds = ds & "User ID=HTS;Password=htshts"
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
con.ConnectionString = ds
|
250
|
+
|
251
|
+
con.Open
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
cmd.ActiveConnection = con
|
256
|
+
|
257
|
+
cmd.CommandTimeout = 0
|
258
|
+
|
259
|
+
cmd.CommandType = adCmdText
|
260
|
+
|
261
|
+
cmd.CommandText = "select DJNAME ? from EDM"
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
Set param = cmd.CreateParameter("DJNAME", adVarChar, adParamInput, 20)
|
266
|
+
|
267
|
+
cmd.Parameters.Append param
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
cmd.Parameters("DJNAME").Value = "Avicii I'm Test"
|
272
|
+
|
273
|
+
rs.CursorLocation = adUseClient
|
274
|
+
|
275
|
+
rs.CursorType = adOpenStatic
|
276
|
+
|
277
|
+
TextBox1.Value = printSql(cmd) 'TextBox1に値を入れる
|
278
|
+
|
279
|
+
rs.Open cmd
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
GoTo FINAL
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
ERROR:
|
288
|
+
|
289
|
+
MsgBox Erl() & "行目:" & ERROR(Err())
|
290
|
+
|
291
|
+
|
292
|
+
|
203
293
|
FINAL:
|
204
294
|
|
205
295
|
'ファイナル処理
|
@@ -214,4 +304,90 @@
|
|
214
304
|
|
215
305
|
|
216
306
|
|
307
|
+
|
308
|
+
|
309
|
+
'printSqlの処理として
|
310
|
+
|
311
|
+
Public Function printSql(ByRef cmd As ADODB.Command) As String
|
312
|
+
|
313
|
+
Dim p As ADODB.Parameter
|
314
|
+
|
315
|
+
Dim vntP As Variant
|
316
|
+
|
317
|
+
Dim inti As Integer
|
318
|
+
|
319
|
+
Dim strR As String
|
320
|
+
|
321
|
+
inti = 1
|
322
|
+
|
323
|
+
ReDim vntP(cmd.Parameters.Count)
|
324
|
+
|
325
|
+
For Each p In cmd.Parameters
|
326
|
+
|
327
|
+
Select Case p.Type
|
328
|
+
|
329
|
+
'ここはニーズに応じてタイプを追加してください
|
330
|
+
|
331
|
+
Case adInteger
|
332
|
+
|
333
|
+
vntP(inti) = p.Value
|
334
|
+
|
335
|
+
Case Else
|
336
|
+
|
337
|
+
vntP(inti) = "'" & p.Value & "'"
|
338
|
+
|
339
|
+
End Select
|
340
|
+
|
341
|
+
inti = inti + 1
|
342
|
+
|
343
|
+
Next
|
344
|
+
|
345
|
+
strR = cmd.CommandText
|
346
|
+
|
347
|
+
For inti = 1 To UBound(vntP)
|
348
|
+
|
349
|
+
strR = Replace(strR, "?", vntP(inti), 1, 1)
|
350
|
+
|
351
|
+
Next
|
352
|
+
|
353
|
+
printSql = strR
|
354
|
+
|
355
|
+
End Function
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
Private Sub UserForm_Click()
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
End Sub
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
'ファイナル処理
|
370
|
+
|
371
|
+
On Error Resume Next
|
372
|
+
|
373
|
+
Set rs = Nothing
|
374
|
+
|
375
|
+
Set con = Nothing
|
376
|
+
|
377
|
+
End Sub
|
378
|
+
|
379
|
+
|
380
|
+
|
217
381
|
```
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
``````test
|
386
|
+
|
387
|
+
ここに言語を入力
|
388
|
+
|
389
|
+
```
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
```
|
6
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
シングルコーテーションを文字として扱う場合、SQL文のため、テキストボックスからデータを入力する際は
|
30
30
|
|
31
|
-
A,B''cde,C,D,Eとなります。2つつける必要があるからです。
|
31
|
+
A,B''cde,C,D,Eとなります。2つつける必要があるからです。[リンク内容](test.txt)
|
32
32
|
|
33
33
|
これで、データベースには
|
34
34
|
|
@@ -60,6 +60,10 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
63
67
|
```VBA
|
64
68
|
|
65
69
|
Option Explicit
|
5
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -88,7 +88,7 @@
|
|
88
88
|
|
89
89
|
Dim con As New ADODB.Connection
|
90
90
|
|
91
|
-
Dim cmd As ADODB.Command
|
91
|
+
Dim cmd As New ADODB.Command
|
92
92
|
|
93
93
|
Dim rs As New ADODB.Recordset
|
94
94
|
|
@@ -126,43 +126,43 @@
|
|
126
126
|
|
127
127
|
cmd.CommandType = adCmdText
|
128
128
|
|
129
|
-
cmd.CommandText = "
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
Set param = cmd.CreateParameter("DJNAME",
|
134
|
-
|
135
|
-
cmd.Parameters.Append param
|
136
|
-
|
137
|
-
Set param = cmd.CreateParameter("SONGNAME",
|
138
|
-
|
139
|
-
cmd.Parameters.Append param
|
140
|
-
|
141
|
-
Set param = cmd.CreateParameter("G
|
142
|
-
|
143
|
-
cmd.Parameters.Append param
|
144
|
-
|
145
|
-
Set param = cmd.CreateParameter("LABEL
|
146
|
-
|
147
|
-
cmd.Parameters.Append param
|
148
|
-
|
149
|
-
Set param = cmd.CreateParameter("YEAR", Num
|
150
|
-
|
151
|
-
cmd.Parameters.Append param
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
'テキストボックスに
|
156
|
-
|
157
|
-
cmd.Parameters("DJNAME").Value =
|
158
|
-
|
159
|
-
cmd.Parameters("SONGNAME").Value =
|
160
|
-
|
161
|
-
cmd.Parameters("G
|
162
|
-
|
163
|
-
cmd.Parameters("LABEL").Value =
|
164
|
-
|
165
|
-
cmd.Parameters("YEAR").Value =
|
129
|
+
cmd.CommandText = "SELECT * FROM EDM WHERE DJNAME = ? AND SONGNAME = ? AND GENRE = ? AND LABEL = ? AND YEAR = ?"
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
Set param = cmd.CreateParameter("DJNAME", adVarChar, adParamInputOutput, 45)
|
134
|
+
|
135
|
+
cmd.Parameters.Append param
|
136
|
+
|
137
|
+
Set param = cmd.CreateParameter("SONGNAME", adVarChar, adParamInputOutput, 30)
|
138
|
+
|
139
|
+
cmd.Parameters.Append param
|
140
|
+
|
141
|
+
Set param = cmd.CreateParameter("GENRE", adVarChar, adParamInputOutput, 25)
|
142
|
+
|
143
|
+
cmd.Parameters.Append param
|
144
|
+
|
145
|
+
Set param = cmd.CreateParameter("LABEL", adVarChar, adParamInputOutput, 20)
|
146
|
+
|
147
|
+
cmd.Parameters.Append param
|
148
|
+
|
149
|
+
Set param = cmd.CreateParameter("YEAR", adVarNumeric, adParamInputOutput, 4)
|
150
|
+
|
151
|
+
cmd.Parameters.Append param
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
'テキストボックスに取得されたもの
|
156
|
+
|
157
|
+
cmd.Parameters("DJNAME").Value = Text6.Text
|
158
|
+
|
159
|
+
cmd.Parameters("SONGNAME").Value = Text7.Text
|
160
|
+
|
161
|
+
cmd.Parameters("GENRE").Value = Text8.Text
|
162
|
+
|
163
|
+
cmd.Parameters("LABEL").Value = Text9.Text
|
164
|
+
|
165
|
+
cmd.Parameters("YEAR").Value = Text10.Text
|
166
166
|
|
167
167
|
|
168
168
|
|
@@ -172,8 +172,14 @@
|
|
172
172
|
|
173
173
|
Else
|
174
174
|
|
175
|
+
rs.CursorLocation = adUseClient
|
176
|
+
|
177
|
+
rs.CursorType = adOpenStatic
|
178
|
+
|
175
179
|
rs.Open cmd
|
176
180
|
|
181
|
+
rs.Open "Update EDM set DJNAME = '" & Text6.Text & "',SONGNAME = '" & Text7.Text & "',GENRE = '" & Text8.Text & "',LABEL = '" & Text9.Text & "', YEAR = '" & Text10.Text & "' where NO = '" & TextBox1.Text & "'", con
|
182
|
+
|
177
183
|
MsgBox "データを更新しました"
|
178
184
|
|
179
185
|
End If
|
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,35 +66,41 @@
|
|
66
66
|
|
67
67
|
Private Sub UserForm_Initialize()
|
68
68
|
|
69
|
-
Text1.Value = Cells(ActiveCell.Row, 1).Value
|
69
|
+
TextBox1.Value = Cells(ActiveCell.Row, 1).Value
|
70
|
-
|
70
|
+
|
71
|
-
Text
|
71
|
+
Text6.Value = Cells(ActiveCell.Row, 2).Value
|
72
|
-
|
72
|
+
|
73
|
-
Text
|
73
|
+
Text7.Value = Cells(ActiveCell.Row, 3).Value
|
74
|
-
|
74
|
+
|
75
|
-
Text
|
75
|
+
Text8.Value = Cells(ActiveCell.Row, 4).Value
|
76
|
-
|
76
|
+
|
77
|
-
Text
|
77
|
+
Text9.Value = Cells(ActiveCell.Row, 5).Value
|
78
|
-
|
78
|
+
|
79
|
-
Text
|
79
|
+
Text10.Value = Cells(ActiveCell.Row, 6).Value
|
80
80
|
|
81
81
|
End Sub
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
Private Sub CommandButton1_Click()
|
85
|
+
Private Sub CommandButton1_Click() 'データ更新
|
86
86
|
|
87
87
|
On Error GoTo ERROR
|
88
88
|
|
89
89
|
Dim con As New ADODB.Connection
|
90
90
|
|
91
|
+
Dim cmd As ADODB.Command
|
92
|
+
|
91
93
|
Dim rs As New ADODB.Recordset
|
92
94
|
|
93
|
-
Dim
|
95
|
+
Dim param As ADODB.Parameter
|
96
|
+
|
94
|
-
|
97
|
+
Set cmd = New ADODB.Command
|
98
|
+
|
99
|
+
Dim ds As String 'データソース定義
|
100
|
+
|
95
|
-
Dim user As String
|
101
|
+
Dim user As String 'ユーザ名
|
96
|
-
|
102
|
+
|
97
|
-
Dim pass As String
|
103
|
+
Dim pass As String 'パスワード
|
98
104
|
|
99
105
|
|
100
106
|
|
@@ -112,13 +118,61 @@
|
|
112
118
|
|
113
119
|
|
114
120
|
|
115
|
-
|
121
|
+
'ここから追記したもの
|
122
|
+
|
123
|
+
cmd.ActiveConnection = con
|
124
|
+
|
125
|
+
cmd.CommandTimeout = 0
|
126
|
+
|
127
|
+
cmd.CommandType = adCmdText
|
128
|
+
|
129
|
+
cmd.CommandText = "Update EDM set DJNAME = '" & Text6.Text & "',SONGNAME = '" & Text7.Text & "',GENRE = '" & Text8.Text & "',LABEL = '" & Text9.Text & "', YEAR = '" & Text10.Text & "' where NO = '" & TextBox1.Text & "'",con
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
Set param = cmd.CreateParameter("DJNAME", varcher2, adParamInput, 40)
|
134
|
+
|
135
|
+
cmd.Parameters.Append param
|
136
|
+
|
137
|
+
Set param = cmd.CreateParameter("SONGNAME", varchar2, adParamInput, 30)
|
138
|
+
|
139
|
+
cmd.Parameters.Append param
|
140
|
+
|
141
|
+
Set param = cmd.CreateParameter("GANRE", varchar2, adParamInput, 25)
|
142
|
+
|
143
|
+
cmd.Parameters.Append param
|
144
|
+
|
145
|
+
Set param = cmd.CreateParameter("LABELE", varcher2, adParamInput, 20)
|
146
|
+
|
147
|
+
cmd.Parameters.Append param
|
148
|
+
|
149
|
+
Set param = cmd.CreateParameter("YEAR", Number, adParamInput, 4)
|
150
|
+
|
151
|
+
cmd.Parameters.Append param
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
'テキストボックスに入力したものを
|
156
|
+
|
157
|
+
cmd.Parameters("DJNAME").Value = "'" & Text6.Text & "'"
|
158
|
+
|
159
|
+
cmd.Parameters("SONGNAME").Value = "'" & Text7.Text & "'"
|
160
|
+
|
161
|
+
cmd.Parameters("GANRE").Value = "'" & Text8.Text & "'"
|
162
|
+
|
163
|
+
cmd.Parameters("LABEL").Value = "'" & Text9.Text & "'"
|
164
|
+
|
165
|
+
cmd.Parameters("YEAR").Value = "'" & Text10.Text & "'"
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
If TextBox1.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or Text10.Text = "" Then
|
116
170
|
|
117
171
|
MsgBox "データをすべて入力してください"
|
118
172
|
|
119
173
|
Else
|
120
174
|
|
121
|
-
rs.Open
|
175
|
+
rs.Open cmd
|
122
176
|
|
123
177
|
MsgBox "データを更新しました"
|
124
178
|
|
@@ -132,13 +186,13 @@
|
|
132
186
|
|
133
187
|
ERROR:
|
134
188
|
|
135
|
-
MsgBox Erl() & "
|
189
|
+
MsgBox Erl() & "行目" & ERROR(Err())
|
136
190
|
|
137
191
|
|
138
192
|
|
139
193
|
FINAL:
|
140
194
|
|
141
|
-
'
|
195
|
+
'ファイナル処理
|
142
196
|
|
143
197
|
On Error Resume Next
|
144
198
|
|
3
修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Excel VBA データベースのデータを更新する際
|
1
|
+
Excel VBA データベースのデータを更新する際のシングルコーテーションについて
|
test
CHANGED
File without changes
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,9 +30,9 @@
|
|
30
30
|
|
31
31
|
A,B''cde,C,D,Eとなります。2つつける必要があるからです。
|
32
32
|
|
33
|
-
これで、
|
33
|
+
これで、データベースには
|
34
34
|
|
35
|
-
A,B'cde,C,D,E このように表示されます。
|
35
|
+
A,B'cde,C,D,E として追加され、シートに表示されるときもこのように表示されます。
|
36
36
|
|
37
37
|
|
38
38
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
その際のシングルコーテーションについて
|
24
24
|
|
25
|
-
データ追加の時、このようなデータを
|
25
|
+
データ追加の時、このようなデータを追加したいとします。
|
26
26
|
|
27
27
|
A,B'cde,C,D,E(,はそれぞれのテキストボックスにという意味です)
|
28
28
|
|