Asprunner 7.2
I am trying to import records from xls file and avoid inserting on import, records that are duplicate for two fields . I have the following code below.
strSQLExists = "select * from Customers Where CustomerID IN (Select CustomerID from Customers where CustomerID = " & values("CustomerID") & ") And EmployeeID IN (Select EmployeeID from Customers where EmployeeID =' " & values("EmployeeID") & "') "
set rsExists = CreateObject("ADODB.Recordset")
rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then
' if record exists do something
BeforeInsert = false
else
' if dont exist do something else
BeforeInsert = True
I have tested this and it still imports duplicate records from import file where there is a CustomerID and EmployeeID record already in Customer table. Any help appreciated . Have tried using raw values but get same result.
CustomerID is Numeric and EmployeeID is text.