Solved

query information from sybase table

Posted on 2002-07-23
2
177 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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