query information from sybase table
Posted on 2002-07-23
I am wanting to know what people would recomend as the best way to query some information from a table on a Sybase database via an ODBC connection through Delphi6.
I have tried using ADO and was able to connect and view all available tables,their index's and display the data through a DBgrid but couldnt quite figure out how to extract some info based on a search e.g search the matter table for the value of fields called 'client' and 'DOB' for matter number 1. I know this could basically be put into a SQL like
"select ('client','DOB') from matter where matter number = 1"
but I am pretty confused with the ADOquery object and its strings?
Could someone suggest what they would consider the best method to bring this information back to some local variable so I could then use them in my program.
The situation would be that my application would need to run these queries from several points around their WAN from the server holding the Sybase database and each of these query points will already have the ODBC driver set-up and functional. Actuall sample code would really be appreciated as would general comments on some pros and cons of the different methods.
Thank for any ideas