Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am I using ADO correctly 1

Status
Not open for further replies.

john230873

Programmer
Oct 3, 2003
89
NZ
I have a SH (Sale_Headers) table and a ST (Sales_Trans) table. I have link the datasource of SH to the Table of ST so that only the transactions of that SH are shown. I am using MSSQL for the database so I was able to monitor the statements. I would have thought that Delphi would do some sort of where's clause on the ST table at the database end but it appears to lookup all the transactions then filter them out its self. As I am looking for speed this is not the best option. Also I am only looking at some fields as chosen by the Table field editor, but the ADOTable is still performing a "select * " is this normal.
 
Working Client/Server you need to use TADOQuery and write your own SQL statements, thus limiting what is pulled from the database to what your application requires.

Actually I suggest you use TADODataset and forget TADOTable and TADOQuery.

Something like
SELECT * FROM Sale_Headers WHERE SH_id=:SH_id
and
SELECT * FROM Sales_Trans WHERE SH_id=:SH_id

This is just a hint to get you going. There are 101 ways to handle master/detail tables from SQL Server into Delphi.

Have fun
Simon
 
Thanks VintageWine, this is now what am I doing but wasn't sure if it was correct, I reading the about.com examples any idea of more ?
 
hi john,
i'm using sql server as my back end as well,but i faced a problem while i try to develop the system to link to the server pc(SQL server).
i've tried out the ado connection component,i failed to test the connection while wanted to build the linking.there is a error message sound like this:

"Test connection failed because of an error in intializing provider login failed for user 'sa'. Reason: Not associated with a trusted SQL Server Connection."

have u ever face such problem before?

thanks.
 
Sammi, you already opened a thread for this, don't use other people's threads...

here's your thread
thread102-798790

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top