Article View: borland.public.cppbuilder.database.ado
Article #1748Please help with code to properly delete a record using ado..3rd post!!!
From: ryan
Date: Wed, 18 Feb 2004 04:23
Date: Wed, 18 Feb 2004 04:23
28 lines
2446 bytes
2446 bytes
i cant seem to perform a query & tell my clientdataset what to delete,
then update the actual adodataset, like it's supposed to. i have
problems, and to work around this i activate my clientdataset AFTER
the query for my adodataset (so the right query is stored) then tell
it what to delete & update, then close my clientdataset again. this
is a pain & i'd like to know the correct way. this method currently
requires i have my forms point to
my ado dataset instead of my client datasets..i know this is wrong,
but cant figure out the correct method. The first line here is when I
activate my clientdataset, after my query to the adodataset. This
clientdataset is used like a "temporary" dataset to get this to work.
Please help so I don't have to use this 'workaround' in my code.
DataModule3->ClientDataSet4->Active = true;
DataModule3->ClientDataSet4->Edit();
if(DataModule3->ClientDataSet4->State == dsEdit)
{
DataModule3->ClientDataSet4->Delete();
DataModule3->ClientDataSet4->ApplyUpdates(-1);
Application->MessageBox("Record
deleted.","Status", MB_OK);
DataModule3->ADOCommand1->CommandText =
"SELECT LoginName, UserRightsLevel FROM
AUTHTABLE";
DataModule3->ADODataSet2->Recordset =
DataModule3->ADOCommand1->Execute();
};
DataModule3->ClientDataSet4->Active = false;
Technical Details
Message-ID:
<2fa56e32.0402172023.57d3dae9@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,2ddba5c8034453a6,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-02-17 20:23:22 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: thedeak@ntslink.net (ryan) Newsgroups: borland.public.cppbuilder.database.ado Subject: Please help with code to properly delete a record using ado..3rd post!!! Date: 17 Feb 2004 20:23:22 -0800 Organization: http://groups.google.com Lines: 28 Message-ID: <2fa56e32.0402172023.57d3dae9@posting.google.com> NNTP-Posting-Host: 208.4.164.128 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1077078202 15884 127.0.0.1 (18 Feb 2004 04:23:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 18 Feb 2004 04:23:22 +0000 (UTC)