🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #606

Re: DeleteRecords()

#606
From: Viatcheslav V. Vassiliev
Date: Mon, 10 Oct 2005 06:33
46 lines
2529 bytes
DELETE FROM PROGRESSRPT is better that DeleteRecords(arAll). Use TADOCommand 
to execute this query, or TADOConnection.ExecuteCommand("..."), or 
TADOQuery.ExecSQL().

//------------------------------------------
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)

"Andre Hayward" <jorhaypi@mweb.co.za> ???????/???????? ? ???????? ?????????: 
news:gscik1lbmrhvc01v7cjnu8c4qecsk8qffi@4ax.com...
> Hi,
>
> I'm trying to delete all the records in a single table with no
> relations to any other table with
>
> if (!dmWorks->ProgressRpt->IsEmpty())
> {
>  dmWorks->ProgressRpt->DeleteRecords(arAll);
> }
> but getting an error message "Operation is not allowed in this
> context"
>
> The error is the same whether you're using a TADOQuery, TADOTable or
> TADODataSet
>
> Nou helpfile says: use the Supports() function to find out whether the
> datase will supports a delete but the supports function is a
> conglomeration of enums and template functions and I can't figure out
> how it should be coded.
>
> In any case Supports() will not solve my problem.  I've also done the
> Delete() function inside a loop for each record but all records are
> for some reason not deleted and an error is not shown.
>
> DELETE FROM PROGRESSRPT  returns an error "Command text does not
> return a resultset" but in any case it works.  Maybe I should ignore
> the error message and stick to SQL??
>
> Any help will be appreciated.
>
> Best Regards
> Ander Hayward. 
Technical Details
Message-ID: <434a0ac7@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <gscik1lbmrhvc01v7cjnu8c4qecsk8qffi@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,af11e39129a3c888
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <gscik1lbmrhvc01v7cjnu8c4qecsk8qffi@4ax.com>
Subject: Re: DeleteRecords()
Date: Mon, 10 Oct 2005 10:33:57 +0400
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 85.93.138.132
Message-ID: <434a0ac7@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1128925895 85.93.138.132 (9 Oct 2005 23:31:35 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail