CPB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Read Only TQuery objects?
I can't find the article at the moment, but the January issue of the Cobb
Group's C++ Builder had an article about the TQuery. Try doing a
search on TUpdateSQL. It can be linked to the TQuery to make
changes to a non-live result set.
Sorry I can't be more help. I am sure somebody will know the
answer. But in the meantime check out the TUpdateSQL.
Duane
At 04:50 PM 3/8/98 , you wrote:
Hello All,
I am creating a TQuery and using the SQL property
to specify a dataset. Whenever I get around to editing fields in the
dataset I use the following commands and receive the folloing error:
"Cannot modify read-only dataset". Does anyone know how to
modify a TQuery dataset?
code:
TQuery *TrackPos = new TQuery(frmMain);
AnsiString TrackToUpdate =
TableCar->FieldByName("TrackNum")->AsString;
int OldPosition =
TableCar->FieldByName("Position")->AsInteger;
TrackPos->DatabaseName = "c:\\cardata";
TrackPos->SQL->Clear();
TrackPos->SQL->Add("SELECT * FROM railcars WHERE
TrackNum=""+TrackToUpdate+"\"");
TrackPos->Open();
do {
if(TrackPos->FieldByName("Position")->AsInteger>OldPosition)
{
TrackPos->Edit(); //Line
giving error
TrackPos->FieldByName("Position")->AsInteger =
TrackPos->FieldByName("Position")->AsInteger - 1;
TrackPos->Post();
}
TrackPos->Next();
} while(!TrackPos->Eof);
W Komornicki's Home Page |
Main Index |
Thread Index