Solved

query information from sybase table

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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 video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

22 Experts available now in Live!

Get 1:1 Help Now