Article View: borland.public.cppbuilder.database.ado
Article #1150Insert & Edit
From: Michele Santucci
Date: Wed, 06 Oct 2004 13:28
Date: Wed, 06 Oct 2004 13:28
79 lines
3615 bytes
3615 bytes
I've got some problems with the following code:
// Insert row in bt table
dmEnvironmentData->adodsEnvironment->Insert();
dmEnvironmentData->adodsEnvironment->FieldValues["Longitude"]=
dLongitude;
dmEnvironmentData->adodsEnvironment->FieldValues["Latitude"]=
dLatitude;
dmEnvironmentData->adodsEnvironment->Post();
dMTemperature = 0;
long IDEnv =
dmEnvironmentData->adodsEnvironment->FieldValues["IDEnv"];
for(int j = 1;j <= iPoints;j++)
{
double dDepth,
dTemperature;
dDepth =
atof(slBuffer->Strings[i+j].SubString(1,8).Trim().c_str());
if((dDepth>dMaxDepth)||(dDepth<dMinDepth))
{
asMessage = "WARN: Cannot import " +
(i+j+1);
asMessage += " line: Depth value out
of bounds!";
throw Exception(asMessage);
}
dTemperature =
atof(slBuffer->Strings[i+j].SubString(9,8).Trim().c_str());
dMTemperature += dTemperature;
// Insert row in bt-rows table
dmEnvironmentData->adodsBRows->Insert();
dmEnvironmentData->adodsBRows->FieldValues["IDEnv"]= IDEnv;
dmEnvironmentData->adodsBRows->FieldValues["Depth"]= dDepth;
dmEnvironmentData->adodsBRows->FieldValues["Temperature"]=dTemperature;
dmEnvironmentData->adodsBRows->Post();
}
dmEnvironmentData->adodsEnvironment->Edit();
// Here's the problem
dmEnvironmentData->adodsEnvironmentTemperature->AsFloat =
(dMTemperature/iPoints);
dmEnvironmentData->adodsEnvironment->Post();
The exception raised is the following:
"Impossibile individuare la riga specificata per l'aggiornamento. �
possibile che alcuni valori siano stati modificati dopo l'ultima operazione
di lettura"
In english:
"Is it impossible to find the specified row for the update. It's possible
that some values have been updated after the last read."
--
================================
Michele Santucci
Software Development Manager
Celin Avio S.r.l.
Via Fontevivo, 21/M 19100 La Spezia
tel. +39-0187564080
================================
Technical Details
Message-ID:
<4163f33c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,f69b0835e23c813b,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Michele Santucci" <michele.santucci.nospam@nospam.celinavio.it> Newsgroups: borland.public.cppbuilder.database.ado Subject: Insert & Edit Date: Wed, 6 Oct 2004 15:28:24 +0200 Lines: 81 Organization: Celin Avio S.r.l. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 62.94.122.226 Message-ID: <4163f33c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1097069372 62.94.122.226 (6 Oct 2004 06:29:32 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail