I read data from two dbf databases using 2 ADOQuery, DATASource and ADOConnection into different DBGrid.

The first table has fields - NC, DOT, GOR, QN, QBT, DDRMNC, QGAN.

The second table is NC, DOT, GOR, QBM, DRS.

It is necessary to combine two tables so that the fields follow in a certain order:

NC DOT(дата) GOR QN QBT QBM QGAN DRMNC=DRS(объеденить в одном поле) 

Sort by NC and DOT upwards. I have never dealt with a database before, so I have great difficulties.

  • You can load data into an intermediate ClientDataSet, MemData and continue to manipulate data in memory. - androschuk

1 answer 1

 SELECT * FROM Первая таблица INNER JOIN Вторая таблица on Вторая таблица.DOT = Первая таблица.DOT ORDER BY Первая таблица.NC 

Like that..

  • Please note - "I read data from two dbf databases using 2 ADOQuery" - Kromster
  • And if I have both databases loaded via OpenDialog and the data change should occur in the program for further uploading to the file, and the source databases should not change? - dega
  • @dega then you can load the data into the intermediate ClientDataSet, MemData ... and work with dialing in memory. Unless of course the base is small. - androschuk
  • And if the bases can be large and small? The user himself will choose which ... - dega