I am exporting data in Excel table to SQL Server Database, If exists UPDATE else INSERT.

The following VBA code works well for exporting to ACCESS Database, 
BUT NOT TO SQL SERVER DATABASE TABLE.

Error Message appear :Invalid Use of Property for .Index and .Seek. 

Please Help !!! Toh

```
Sub ExcelDataToSql ()

Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
Dim lastrow As Long, o As Long

Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset

cn.Open "Provider=SQLNCLI11;Server=***;Database=****;Trusted_Connection=yes;"
rs.CursorLocation = adUseServer
rs.Open "InventorySQL", cn, 1, 3, adCmdTableDirect

' Get Lastrow
Worksheets("InventoryEXCEL").Select
lastrow = Worksheets("InventoryEXCEL").Cells(rows.Count, 1).End(xlUp).Row
r = 2 ' the start row in the worksheet
For o = 2 To lastrow

    'Check For Duplicate In Database SQL
    With rs
        .Index = "PrimaryKey"
        .Seek Range("A" & r).Value

        If .EOF Then
            .AddNew            
            'If No Duplicate insert New Record
            rs.Fields("oPartno") = Range("A" & r).Value
            rs.Fields("oDesc") = Range("B" & r).Value
            rs.Fields("oCost") = Range("C" & r).Value
        .update
        Else          
            ' If Duplicate Found Update Existing Record
            rs.Fields("oDesc") = Range("B" & r).Value
            rs.Fields("oCost") = Range("C & r).Value
            .Update
        End If
    End With

Next o
    rs.Close
    Set rs = Nothing
    cn.Close
    Set cn = Nothing
    MsgBox "Posting Completed"
End Sub

```

---

. Index = "PrimaryKey" --- Sysntax Error : Invalid Use of Property
.Seek Range ("A" & r).Value Sysntax Error :