Thread: ADOQuery error,delete record

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

    ADOQuery error,delete record

    Hi i made the above query in BCB 6 but when i run my application brings me an error in params


    ADOQuery1->Close();
    ADOQuery1->SQL->Clear();
    Edit4->Text=InputBox("Name","Search:","");

    ADOQuery1->SQL->Add("DELETE FROM Charl WHERE PictureName='"+Edit4->Text+"'");

    ADOQuery1->Params->Items[0]->AsString= ADODataSet1->FieldByName("Leite")->AsString;
    ADOQuery1->Prepared=true;
    ADOQuery1->ExecSQL();

    ADODataSet1->Refresh();

    what is wrong???

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    What line? what is exact the error message
    Have you checked all names used like
    Charl
    PictureName
    Leite

    Do you have the table, column and field with these names?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    46
    Yes thats the table and the errors i got one in ADOQuery->Parameters say that its no right...If i leave that outside the code then my application run the query but brings me an error that say "Value of key on this record havechange or deleted in place that record saved"
    The strange thing is that when i press ok in error the query delete the record as i want...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with binary file c++
    By lucky_mutani in forum C++ Programming
    Replies: 4
    Last Post: 06-05-2009, 09:24 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. updating and deleting a record
    By Burritt in forum C Programming
    Replies: 2
    Last Post: 04-19-2003, 04:58 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. behind and confused
    By steviecrawf in forum C Programming
    Replies: 1
    Last Post: 11-09-2001, 12:51 PM