Link to home
Start Free TrialLog in
Avatar of myleseven
myleseven

asked on

How do you delete a record from a Paradox table

Hi there I am struggling to delete a record from a DB table, it shold be easy but I just am not sure how to do it...

Here is my code but the delete procedure asks for parameters and I am not sure what they are for:

function RemoveAccountfromAllAccountsTable(SelectedAccount : string):boolean;
//Purpose: to remove the Accoount from the AllEmailAccounts table
var
  AccountRemoved : boolean;
begin
  AccountRemoved := false;
  with datasimplemail do
  begin
      tblAllEmailAccounts.First;
      while not tblAllEmailAccounts.Eof do
      begin
        if (tblAllEmailAccountsAccountName.value = SelectedAccount) then //you have found the selected account
        begin
          tblAllEmailAccounts.Edit;
          //Delete;         // I need a procedure to Delete the re     cord that we have looped to!!!
          AccountRemoved := true
          break;
        end;
        tblAllEmailAccounts.Next;
      end;
  end;
  result := AccountRemoved;
end;

what do you suggest
Myles :)
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of myleseven
myleseven

ASKER

Silly me, I htink I have been staring at the screen to long...
so all i needed to do was put the tablename in front of the delete cmd!

Thanks meikl

Hey do you mind if I ask you a quick question. You know the menu on the left hand side of the unit that shows a tree list of all procedures and funcitons in the unit. Well mine has dissappeared and I am not sure how to get it back, do you know how?
I also have lost the functionality to be able to automatically decalse a function orprocedure header by using shitft+cntrl + C.
DO you also know how to fix that?
regards
Myles :)
well, no delphi on hand yet,
but hotkeys you can define in the options,
and the projecttree or codeexplorer you can call in view under the project-menu

well, just from head,
if i am back this evening, i can be more detailed

meikl ;-)
>and the projecttree or codeexplorer you can call in view under the project-menu
could be also the View-Menu (not in mind correct yet)

meikl ;-)
Thanks meikl,
I also have no delphi on hand at the moment and probably wont be able to try for the next few days, but I appreciate your response :)
I will let you know how it goes when I try...

regards
Myles :)
thanks for your help earlier in regard to the codeexploror and project tree.
I tried you suggestions but I could not seem to find them under the view-menu

Myles :)