Take values from databasefield,calculate them and bring them back

This is a discussion on Take values from databasefield,calculate them and bring them back within the Windows Programming forums, part of the Platform Specific Boards category; Hi i made an application in BCB6 and connected with SQL Server 2000. insert Code: int i,records; records=ADOTable1->RecordCount; //Array for ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    43

    Take values from databasefield,calculate them and bring them back

    Hi i made an application in BCB6 and connected with SQL Server 2000.

    insert
    Code:
      int i,records;
      records=ADOTable1->RecordCount;
    
      //Array for save values from Access
      int *getvalues=new int[records];
    
      //Take values from Access
      for(i=0;i<records;i++)
      {
      getvalues[i]=ADOTable1->Fields->Fields[1]->AsInteger;
      ADOTable1->Next();
      }
      ADOTable1->First();
      for(i=0;i<records;i++)
      {
    
      ADOTable1->Append();
      ADOTable1->FieldValues["Pow"]=getvalues[i]*getvalues[i];
      ADOTable1->Post();
      }
    So i made the above code. I want to take the values of table of specifiec field "FileValues" calculate them and post them to new Field "Pow" but it doesnt work my code. Any ideas??
    Last edited by Leite33; 11-06-2006 at 01:40 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,422
    Clear table or specifiec fields
    One question at a time please.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21