I have an ADO query that I use to gather data and later use to update that data. (Embarcadaro C++ Xe2 & Oracle 10g). Rownum (aliased to pgnum) is also selected and in this query. When posting data edited via this query, I receive invalid identifier "pgnum". This seems to be an issue specifically with ADO as this same code worked in previous versions of our software. We recently converted all our queries to ADO from Tquery (old BDE Driven). Adding "pgnum" to the queries persistent fields does not help. Any advice would be greatly appreciated. Table1 is an ADOQuery.
sql = "SELECT ROWNUM PGNUM, A.* FROM DOCUMENT_IMAGE A WHERE DOCNO = " + String(Form1->qryDocumentDOCNO->AsInteger) + " ORDER BY ROWNUM ";
Table1->Close();
Table1->SQL->Clear();
Table1->SQL->Add(sql);
Table1->Open();
Table1->Edit();
Table1IMAGE->LoadFromFile(filepath);
if (Table1->Modified){
Table1->Post();
}
After tons of research and testing I could get nothing to work while keeping rownum in the query. I'm honestly not sure what it was accomplishing, I took this project over from someone else. Anyway, I removed rownum and used a different field to order the query by, problem solved.