I have this code below that updates a dbf file now this code before also updates a cdx file but I changed something in the values I added now the cdx file is not inline with the dbf. I have tried to "reindex" and "SET INDEX TO" however everytime I do an insert in the dbf table the modified date of the cdx file stays the same as the old one. Should the cdx be updated everytime there is something new inserted?
DIAGNOSTICS_CHECKPOINT;
LOG(L"AutoLoad File Connection String");
LOG(this->_connectionstring.c_str());
cnn->CursorLocation = adUseClient;
try { hr = cnn->Open(this->_connectionstring.c_str(), L"", L"", 0); }
catch (_com_error& e)
{ wss.str(L"");
wss << L"Opening the AutoloadFile connection from '"
<< _connectionstring.c_str()
<< L"' has failed (COM Error: " << e.ErrorMessage()
<< L", " << hr << L")."
<< std::endl;
LOG(wss.str().c_str());
throw;
}
DIAGNOSTICS\_CHECKPOINT;
wss.str(L"");
wss << L"INSERT INTO "
<< this->\_tablename
<< L" VALUES ('"
<< trans\_id << L"','"
<< params << L"','"
<< status << L"',"
<< rec\_no << L")"
;
DIAGNOSTICS\_CHECKPOINT;
std::wstring sql(wss.str().c\_str());
LOG(L"Executing INSERT into the autoload file");
LOG(sql.c\_str());
try
{ rs->Open(sql.c\_str(), cnn.GetInterfacePtr(),
adOpenForwardOnly, adLockReadOnly, adCmdText);
}
catch (\_com\_error& e)
{ wss.str(L"");
wss << L"Executing SQL statement:\\n"
<< sql.c\_str()
<< L"'\\n...has failed (COM Error: "
<< e.Error() << L", '"
<< e.ErrorMessage()
<< L"')."
<< std::endl;
LOG(wss.str().c\_str());
throw;
}