1

Topic: It is impossible to deduce on DBGrid

Hello.
It is impossible to deduce on DBGrid id-shnikov surnames of doctors
I do so:

TForm5.DBGrid1Mousep
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add (' select date, id_doctor from cards');
ADOQuery2.open;

Deduces  on DBGrid

TForm5.DBGrid1Mousep
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add (' select date, id_doctor, users.name from cards join users on users.name = cards.id_doctor ');
ADOQuery2.open;

When I do so - simply any response - empty DBGrid.
The moderator: Use a tag (button) SRC for code design, please.

2

Re: It is impossible to deduce on DBGrid

terlalex> When I do so - simply any response - empty dbgreed (((
Or in  the list of fields it is necessary ;
Or (most likely) the list of columns in .

3

Re: It is impossible to deduce on DBGrid

Here the list of columns in ,  all are marked.
But any is not deduced (

4

Re: It is impossible to deduce on DBGrid

ADOQuery2 It turns out empty, for some reason, after request performance

5

Re: It is impossible to deduce on DBGrid

It is strange, when delivered fields in inverted commas
ADOQuery2.SQL.Add (' select ` date `, ` id_doctor `, ` users.name ` from cards join users on ` users.name ` = ` cards.id_doctor ` ');
Writes an error
Unknown column ' users.name ' in ' field list ".

6

Re: It is impossible to deduce on DBGrid

Here an error
ADOQuery2.SQL.Add (' select date, id_doctor, users.name from cards join users on users.name = cards.id_doctor ');
It is impossible to connect on different fields. I.e. users.name - that I so understand a line with , and cards.id_doctor is a type integer
Most likely it is necessary so
ADOQuery2.SQL.Add (' select date, id_doctor, users.name from cards join users on users.id = cards.id_doctor ');

7

Re: It is impossible to deduce on DBGrid

And well, it is possible also request wrong.
Beforehand always check requests in
Any DB-tool for your DB.

8

Re: It is impossible to deduce on DBGrid

THANKS!!!!!!
All earned!!!