Solved

query information from sybase table

Posted on 2002-07-23
2
174 Views
Last Modified: 2011-09-20
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

Dave
0
Comment
Question by:monitorwa
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 7171190
your statement should be like

select client, DOB from matter where matter number = 1

supply your daoquery with this

if you need the values in vars, then use

adoquery1.open;
clientvar := adoquery1.fieldbyname('client'),asstring;
dobvar := adoquery1.fieldbyname('DOB'),asstring;
adoquery1.close;

hope this helps

meikl ;-)

btw. what different methods?
0
 

Author Comment

by:monitorwa
ID: 7176569
thanks meikl
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now