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.
Dim oConn As Object
Dim oRS As Object
Dim sSQL As String