🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: cancel deleting of record

#821
From: Ondrej Gratz
Date: Wed, 25 May 2005 15:01
37 lines
2016 bytes
  void __fastcall TDataModule1::NarocilniceBeforeDelete(TDataSet *DataSet)
  {

     if(DataModule1->ShemaT->RecordCount > 0)
     {
        ShowMessage("Delete data in Shema first!");
        Abort();
     }
  }

Sincerely
Ondrej Gratz

Borut wrote:
> Hello!
> 
> I am using BCB6, ADO, MSSQL, DBNavigator
> Is it possible to prevent a record to be deleted if user clicks Delete 
> button on Navigator.
> 
> I tried like this, but a record is deleted anyway:
> 
> void __fastcall TDataModule1::NarocilniceBeforeDelete(TDataSet *DataSet)
> {
> 
>    if(DataModule1->ShemaT->RecordCount > 0)
>    {
>       ShowMessage("Delete data in Shema first!");
>       DataSet->Cancel();
>    }
> }
> 
> Thx in advance
> Borut
> Slovenia
> 
> 
Technical Details
Message-ID: <42949367@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!easynet-quince!easynet.net!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!217.73.144.45.MISMATCH!ecngs!feeder2.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <429491d8@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,769db7213d949363
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 25 May 2005 17:01:57 +0200
From: Ondrej Gratz <gratzo@atlas.cz>
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: cancel deleting of record
References: <429491d8@newsgroups.borland.com>
In-Reply-To: <429491d8@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 0521-2, 25.05.2005), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 85.160.73.218
Message-ID: <42949367@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1117033319 85.160.73.218 (25 May 2005 08:01:59 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!easynet-quince!easynet.net!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!217.73.144.45.MISMATCH!ecngs!feeder2.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail