E
E
EVOSandru62014-11-18 12:47:39
MySQL
EVOSandru6, 2014-11-18 12:47:39

How to extract data from a successful sql query in cbuilder?

Good afternoon, such a situation, I completed the request, and you need to pull it out in a memo record. Interested in 2 Options, filling in a loop and forming an array with subsequent output from it to a memo, please help!

TADOQuery * divLike = new TADOQuery;
divLike->Connection = "DB";
divLike->Active = true;
divLike->SQL = AnsiString("SELECT * FROM t_division WHERE SHIFR LIKE '") + dShifr + AnsiString("%'");

// while(sql->LoadStringA())

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Makari4DM, 2015-02-02
@Makari4DM

probably first you need to swap two lines (fill in the query text, then execute):
divLike->SQL = AnsiString("SELECT * FROM t_division WHERE SHIFR LIKE '") + dShifr + AnsiString("%'");
divLike->Active = true;
and then divLike->Fields[<field number>]...
if my memory serves me: there is also something like divLike->FieldCount
Here for Delphi: www.cyberforum.ru/delphi-database/thread569817.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question