I am creating an automate file to update the currency rates in the CurrencyTable (dB) on a button click. I have refer to the example as in [this post](https://stackoverflow.com/questions/52565661/update-sql-from-excel-sheet-using-vba).
My **Excel data** is as below:

```
CsName    Rate
AUD       1.23
BHD       2.23
BND       3.23
EUR       4.23
IDR       5.23
INR       6.23
MYR       7.23
OMR       8.23
SGD       9.23
THB       10.23
USD       11.23

```

The code seems to work fine, however it does not updating as per the Excel data, instead, it only took the 4th row value for everything.
[Here are the updated result](https://i.stack.imgur.com/JUkqs.png).

Below are my codes:

```
Sub UpdateCR()

Dim con As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim i As Long
Dim vDB As Variant
Dim Ws As Worksheet

con.ConnectionString = "Provider=SQLOLEDB.1;Password=1234;Persist Security Info=False;User ID=Guest;Initial Catalog=ABC;Data Source=XYZ"
con.Open

Set cmd.ActiveConnection = con
Set Ws = ActiveSheet

vDB = Ws.Range("a1").CurrentRegion

For i = 2 To UBound(vDB, 1)
    cmd.CommandText = "UPDATE CurrencyTable SET Rate='" & vDB(i, 2) & "' WHERE CsName ='" & vDB(i, 1) & "' "
    cmd.Execute
Next i

con.Close

MsgBox "Exchange rates successfully updated"

Set con = Nothing

End Sub

```

Does anyone know why is this happening? Is it related to the UBound function?

Any helps on this would be much appreciated!