Here is the puzzling problem:
I trying to delete two records in SQL by Name. The count in the collection is 2. It will go through the first time, but when it gets to:
Set doc = ndc.GetNextDocument(doc)
It will then jump to the ErrorExe:.
Now here is the wierd part, It will remove the record from SQL.
Here is the Code:
Set ndc = db.UnprocessedDocuments
Set doc = ndc.getfirstdocument
Do While Not doc Is Nothing
qrystr = {DELETE FROM dbo.Partners WHERE(Name = '} + doc.PartName(0) + {')}
qry.SQL = qrystr
result.execute
'Call doc.RemovePermanently(True)
Call ndc.DeleteDocument(doc)
Set doc = ndc.GetNextDocument(doc)
Loop
result.Close(DB_CLOSE)
con.Disconnect
ErrorExe:
Msgbox "Error during Execution"
Thanks for the help in advance.
Dave