As it says, I think the root of my problems are in the cursor settings but I'm struggling to nail it down.
I have some code below and basically it's comparing two tables and finding the total number of records that have no match.
It works so far but it keeps returning a total of -1 which I know is indicative of a cursor but I can't seem to bottom it out.
Could someone point me in the right direction please?
I have some code below and basically it's comparing two tables and finding the total number of records that have no match.
It works so far but it keeps returning a total of -1 which I know is indicative of a cursor but I can't seem to bottom it out.
Could someone point me in the right direction please?
Code:
Set adoCon2 = CreateObject("ADODB.Connection")
adoCon2.Open "Provider = Microsoft.ACE.OLEDB.12.0; " & _
"Data Source = " & strDB & ";" & _
"Persist Security Info = False;"
strSQL4 = "SELECT Tbl_DataTest.EnterName " & _
"FROM Tbl_DataTest LEFT JOIN Tbl_Employee ON Tbl_DataTest.[EnterName] = Tbl_Employee.[EmpName] " & _
"WHERE (((Tbl_Employee.EmpName) Is Null));"
adoRs2.Open strSQL4, adoCon2
totals = adoRs2.RecordCount
Debug.Print totals
adoRs2.Close
adoCon2.Close
Set adoRs2 = Nothing
Set adoCon2 = Nothing