Article View: borland.public.cppbuilder.database.ado
Article #1756Can't properly delete record using ado
From: ryan smothers
Date: Fri, 20 Feb 2004 16:26
Date: Fri, 20 Feb 2004 16:26
31 lines
2498 bytes
2498 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. Please help...
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;
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.561 / Virus Database: 353 - Release Date: 1/13/2004
Technical Details
Message-ID:
<403634e2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,40c67cfe2e4817d,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-02-20 08:40:39 PST Reply-To: "ryan smothers" <thedeak@ntslink.net> From: "ryan smothers" <thedeak@ntslink.net> Newsgroups: borland.public.cppbuilder.database.ado Subject: Can't properly delete record using ado Date: Fri, 20 Feb 2004 10:26:02 -0600 Lines: 33 Organization: simple creations X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 199.190.202.101 Message-ID: <403634e2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077294306 199.190.202.101 (20 Feb 2004 08:25:06 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail