I am quite new to working with SQL databases in excel VBA.
I have come up with the following code, which writes a range of cells to a table in a SQL database.
Now i have this working i want to query a different table in the database which will loop through the dataset and compare what is entered in to the cells in excel to make sure they exist in that database before writing the range of cells to the original table (just to add some validation)
I have tried many things and can not get this working so any help at all will be greatly appreciated.

thank you,

ps Code:

Sub SubmitInterchange()

Dim oConn As Object
Dim oRS As Object
Dim sSQL As String

Set oConn = CreateObject("ADODB.Connection")
oConn.Open = "Provider=sqloledb;" & _
"Data Source=GW-SYSPRO-01;" & _
"Initial Catalog=SysproCompany2;" & _
"User Id=****;" & _

For n = 10 To 109

StockCode = Worksheets("Interchange_Insert").Cells(n, 4).Value
Barcode = Worksheets("Interchange_Insert").Cells(n, 5).Value

If StockCode > 1 Then

MsgBox "StockCode:" & StockCode & " Barcode:" & Barcode & ""
sSQL = "INSERT INTO InvMaster(StockCode, DrawOfficeNum) VALUES ('" & StockCode & "', '" & Barcode & "')"
oConn.Execute sSQL
End If

Next n

Set oConn = Nothing

End Sub