I
I
Ilya Fernandez2019-06-14 18:25:41
SQL
Ilya Fernandez, 2019-06-14 18:25:41

What is the correct way to display the result of a SQL query in an Edit field in C++?

It is necessary to count the number of records in the table between two dates specified by the user. and display in the Edit field.
DM->ADOQueryWork->SQL->Text = "Select count(*) from sale where sale.date between '" + DateTimePicker1->Date + "' and '" +DateTimePicker2->Date+"';"; // here is the query itself
Edit1->Text=DM->ADOQueryWork->Fields->Fields[0]->AsString; In this scenario, it gives an error "Access Violation." Am I correctly assigning the query result to the edit? a bit confused with AdoQuery properties. Or is the error most likely related to the database?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question