Article View: borland.public.cppbuilder.database.ado
Article #1176Re: Deleting a whole recordset
From: Viatcheslav V. Vassiliev
Date: Tue, 19 Oct 2004 12:34
Date: Tue, 19 Oct 2004 12:34
67 lines
3579 bytes
3579 bytes
As ADO documentation (in MSDN) says: "adAffectAll and adAffectAllChapters are not valid arguments to Delete". In Delphi/BCB this corresponds to arAll and arAllChapters. TADODataSet::DeleteRecords() has one parameter - AffectRecords - it is by default arAll. //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net http://www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Michele Santucci" <michele.santucci.nospam@nospam.celinavio.it> �������/�������� � �������� ���������: news:417379d1@newsgroups.borland.com... > Thank you! > > Of course this will work but since I prefer not to mix different ways of > programming: there's a way to accomplish that by using > TADODataSet methods? > > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> ha scritto nel > messaggio news:417155f1$1@newsgroups.borland.com... > > If you need to delete all records in table, it is usually more effective > to > > execute DELETE FROM TableName SQL command, for MS Access - DELETE * FROM > > TableName, for MS SQL Server TRUNCATE TableName. > > > > //------------------------------------------ > > Regards, > > Vassiliev V. V. > > http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + > > ADO.Net > > http://www.oledbdirect.com - The fastest way to access MS SQL Server, > > MS Jet (Access) and Interbase (through OLEDB) > > > > "Michele Santucci" <michele.santucci@celinavio.it> �������/�������� � > > �������� ���������: news:41711cac@newsgroups.borland.com... > > > I have a form showing up a table content by data-aware components > > connected > > > to a dataset I have to empty the underlying table and so I tought tou > use > > > DeleteRecords method.. but If I try I got an exception of this kind: > > > > > > Project Environment.exe raised exception class EDatabaseError with > message > > > 'Operation not permitted in the current context'. Process stopped. Use > > Step > > > or Run to continue. > > > > > > The 'faulty' code is that: > > > > > > dmEnvironmentData->adodsEnvironment->DisableControls(); > > > dmEnvironmentData->adodsEnvironment->DeleteRecords(); > > > dmEnvironmentData->adodsEnvironment->EnableControls(); > > > > > > > > > -- > > > > > > bye by(t)e[z]....TuX! > > > > > > > > > > > >
Technical Details
Message-ID:
<417509da$1@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-mailReferences:
<41711cac@newsgroups.borland.com> <417155f1$1@newsgroups.borland.com> <417379d1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,92d5af6035d603fd X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <41711cac@newsgroups.borland.com> <417155f1$1@newsgroups.borland.com> <417379d1@newsgroups.borland.com> Subject: Re: Deleting a whole recordset Date: Tue, 19 Oct 2004 16:34:34 +0400 Lines: 69 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: 213.234.218.42 Message-ID: <417509da$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1098189274 213.234.218.42 (19 Oct 2004 05:34:34 -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