<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — [Script] Multiple select records in TableGrid for removing]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=1433</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=1433&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [Script] Multiple select records in TableGrid for removing.]]></description>
		<lastBuildDate>Thu, 28 Jan 2021 10:50:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [Script] Multiple select records in TableGrid for removing]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39878#p39878</link>
			<description><![CDATA[<div class="quotebox"><cite>CDB wrote:</cite><blockquote><div class="quotebox"><cite>vanadu55 wrote:</cite><blockquote><p>Thanks. I&#039;ve figure it out by myself.</p></blockquote></div><br /><p>What did you do to get it to work?</p></blockquote></div><p>It was quite simple, really and it was in another post here in the forum:</p><div class="codebox"><pre><code>procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
var
id: integer;
begin
 id := Form1.GridEmployees.dbItemID;
 SQLExecute (&#039;DELETE FROM employees WHERE id = &#039; + IntToStr(id));

Form1.GridEmployees.dbUpdate;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (vanadu55)]]></author>
			<pubDate>Thu, 28 Jan 2021 10:50:26 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39878#p39878</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Multiple select records in TableGrid for removing]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39420#p39420</link>
			<description><![CDATA[<div class="quotebox"><cite>vanadu55 wrote:</cite><blockquote><p>Thanks. I&#039;ve figure it out by myself.</p></blockquote></div><br /><p>What did you do to get it to work?</p>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Wed, 16 Dec 2020 18:34:54 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39420#p39420</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Multiple select records in TableGrid for removing]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39415#p39415</link>
			<description><![CDATA[<p>Thanks. I&#039;ve figure it out by myself.</p>]]></description>
			<author><![CDATA[null@example.com (vanadu55)]]></author>
			<pubDate>Wed, 16 Dec 2020 10:11:32 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39415#p39415</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Multiple select records in TableGrid for removing]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39405#p39405</link>
			<description><![CDATA[<div class="quotebox"><cite>DriveSoft wrote:</cite><blockquote><p>Multiple select records in TableGrid for removing </p><br /><div class="codebox"><pre><code>procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
var
   i,c: integer;
   iColumn: integer;
begin
     iColumn := Form1.GridEmployees.Columns.Count-1; // in last column stored id of record (last column hided)

     c := Form1.GridEmployees.RowCount - 1; // count of records in TableGrid
     for i :=0 to c do
         if Form1.GridEmployees.Selected[i] then // if record selected
            SQLExecute(&#039;DELETE FROM employees WHERE id = &#039; + Form1.GridEmployees.Cells[iColumn, i]); // SQL query for selected record

     Form1.GridEmployees.dbUpdate;
end;

begin
     Form1.GridEmployees.Options := Form1.GridEmployees.Options + goMultiSelect;
end.</code></pre></div></blockquote></div><br /><p>This code does not work in MVD version 6.4 in version 6.2 works without any issue. It gives an error message near &quot; &quot;:syntax error on SQLExecute on DELETE FROM employees Where id = .</p><p>Can someone help to fix this code for MVD 6.4?</p><p>Thanks in advance.</p>]]></description>
			<author><![CDATA[null@example.com (vanadu55)]]></author>
			<pubDate>Tue, 15 Dec 2020 11:19:41 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39405#p39405</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Multiple select records in TableGrid for removing]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=8337#p8337</link>
			<description><![CDATA[<p>An another example, how to multiselect items like checkbox.<br /><strong>Download project:</strong></p>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Thu, 18 Jun 2015 10:38:26 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=8337#p8337</guid>
		</item>
		<item>
			<title><![CDATA[[Script] Multiple select records in TableGrid for removing]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=7800#p7800</link>
			<description><![CDATA[<p>Multiple select records in TableGrid for removing </p><br /><div class="codebox"><pre><code>procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
var
   i,c: integer;
   iColumn: integer;
begin
     iColumn := Form1.GridEmployees.Columns.Count-1; // in last column stored id of record (last column hided)

     c := Form1.GridEmployees.RowCount - 1; // count of records in TableGrid
     for i :=0 to c do
         if Form1.GridEmployees.Selected[i] then // if record selected
            SQLExecute(&#039;DELETE FROM employees WHERE id = &#039; + Form1.GridEmployees.Cells[iColumn, i]); // SQL query for selected record

     Form1.GridEmployees.dbUpdate;
end;

begin
     Form1.GridEmployees.Options := Form1.GridEmployees.Options + goMultiSelect;
end.</code></pre></div><br /><p><strong>Download project:</strong><br /><a href="http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=657&amp;download=1">http://myvisualdatabase.com/forum/misc. … download=1</a></p>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Wed, 20 May 2015 10:43:14 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=7800#p7800</guid>
		</item>
	</channel>
</rss>
