Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:00:52+00:00 2026-06-04T17:00:52+00:00

I’m writing a simple database editor as my first Delphi program. I don’t have

  • 0

I’m writing a simple database editor as my first Delphi program.

I don’t have any problems with Delphi, only with the connection through the database.

I load the data in the datagrid with a -> sqlConnection -> sqlDataSet -> sqlDataprovider -> Clientdataset -> Datasource

I insert/delete records with a separate connection + SqlQuery for each.

I change the records with DBEdit

The problems occur when after I insert/delete a record, and I make a change to a record, and want to update the changes, I get the following error

Connection is busy for results from another command.

Code:

procedure TDatabaseApp.bNieuwClick(Sender: TObject);
begin

//Waardes invullen in de query statement!

SQLInsert.ParamByName('naam').asString := txtNaam2.Text;
SQLInsert.ParamByName('brouwernr').asString := txtBrouwerNR.Text;
SQLInsert.ParamByName('soortnr').asString := TXTSoortNR.Text;
SQLInsert.ParamByName('alcohol').asString := TxtAlcohol.Text;

//query
SQLInsert.ExecSQL();
SQLInsert.Close();

//Reload datagrid after record has been inserted!
Refresh();

end;

Refresh code

procedure   TDatabaseApp.Refresh();
begin

//After a insert/delete query i call this statement, and changes made with the DBEdit are cancelled = temp solution.
  ClientDataSet1.CancelUpdates();  

  SQLDataSet1.Open();
  ClientDataSet1.Open();
  SQLDataSet1.Refresh();
  ClientDataSet1.Refresh();
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:00:53+00:00Added an answer on June 4, 2026 at 5:00 pm

    As your ClientDataSet is linked to your DataSetProvider and your DataSetProvider is linked to your SQLDataSet you should NEVER manipulate the SQLDataSet directly, but instead do all operations using the ClientDataSet.

    So, you will have:

    procedure TDatabaseApp.Refresh();
    begin
        //ClientDataSet1.CancelUpdates();  //will raise an error depends on the CDS state
        ClientDataSet1.Close;  
        ClientDataSet1.Open();
    
        //SQLDataSet1.Open(); //not necessary, as you already open the CDS
        //SQLDataSet1.Refresh(); //not necessary, as you already open the CDS
        //ClientDataSet1.Refresh(); //not necessary, as you already open the CDS
    end;
    

    But i would suggest you to also use the CDS for inserts, dispensing the use of the “SQLInsert” object. This way the things will become much simpler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.