<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Database Code Help' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Database Code Help' posted on the 'C++ Builder' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 09 Feb 2012 09:05:57 -0800</pubDate>
    <lastBuildDate>Thu, 09 Feb 2012 09:05:57 -0800</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Database Code Help</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/409330/409330/database-code-help/</link>
      <description>Hi People&lt;br /&gt;
&lt;br /&gt;
I'm new in database programming, i have an Access database and i'm trying to eliminate some records in a table, here is the code&lt;br /&gt;
&lt;br /&gt;
Table6-&amp;gt;First();&lt;br /&gt;
  for(int i=0;i&amp;lt;Table6-&amp;gt;RecordCount;i++){&lt;br /&gt;
    placa=Table6-&amp;gt;FieldByName("Placa")-&amp;gt;AsString;&lt;br /&gt;
    tiempo=Table6-&amp;gt;FieldByName("Tiempo")-&amp;gt;AsString.ToDouble();&lt;br /&gt;
    for(int j=0;j&amp;lt;Table6-&amp;gt;RecordCount;j++){&lt;br /&gt;
     Table6-&amp;gt;First();&lt;br /&gt;
     Table6-&amp;gt;MoveBy(j);&lt;br /&gt;
     placa2=Table6-&amp;gt;FieldByName("Placa")-&amp;gt;AsString;&lt;br /&gt;
     tiempo1=Table6-&amp;gt;FieldByName("Tiempo")-&amp;gt;AsString.ToDouble();&lt;br /&gt;
     if(placa==placa2){&lt;br /&gt;
       if(tiempo&amp;lt;tiempo1){&lt;br /&gt;
         valor = Variant(tiempo1);&lt;br /&gt;
         Table6-&amp;gt;Locate("Tiempo",valor,Opts);&lt;br /&gt;
         Table6-&amp;gt;Delete();&lt;br /&gt;
         Table6-&amp;gt;Refresh();&lt;br /&gt;
       }&lt;br /&gt;
       if(tiempo1&amp;lt;=tiempo){&lt;br /&gt;
         valor = Variant(tiempo);&lt;br /&gt;
         Table6-&amp;gt;Locate("Tiempo",valor,Opts);&lt;br /&gt;
         Table6-&amp;gt;Delete();&lt;br /&gt;
         Table6-&amp;gt;Refresh();&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
    }&lt;br /&gt;
    Table6-&amp;gt;First();&lt;br /&gt;
    Table6-&amp;gt;MoveBy(i);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The idea is when placa=placa2 make a comparison of the field "Tiempo"&lt;br /&gt;
if the time of placa is less than time of placa2 the record that must be delete is placa2 else, the record must be delete it placa, i don't know what's the error here, i'll be very grateful if you can help me.&lt;br /&gt;
&lt;br /&gt;
Alejandro&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/409330/409330/database-code-help/</guid>
      <pubDate>Sun, 15 Nov 2009 17:09:22 -0800</pubDate>
      <category>C++ Builder</category>
    </item>
  </channel>
</rss>
