Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
compare value between file text and database Posted by dhenys on 15 Oct 2006 at 9:12 PM
i have a homework...my homework is to read file text, compare with the database and show it up. The problem is that i must show it in form with RGB color...the point is if the value in text file is 1 then i must compare with my database,check if that value in database and then i must show it in form is red color.if the value in text file is 2 then i must show in form green,3 is blue, 4 is white.Help me...
Report
Re: compare value between file text and database Posted by zibadian on 15 Oct 2006 at 9:23 PM
: i have a homework...my homework is to read file text, compare with the database and show it up. The problem is that i must show it in form with RGB color...the point is if the value in text file is 1 then i must compare with my database,check if that value in database and then i must show it in form is red color.if the value in text file is 2 then i must show in form green,3 is blue, 4 is white.Help me...
:
Use a case statement to set the color. Then show the value.
Report
Re: compare value between file text and database Posted by dhenys on 15 Oct 2006 at 9:31 PM
: : i have a homework...my homework is to read file text, compare with the database and show it up. The problem is that i must show it in form with RGB color...the point is if the value in text file is 1 then i must compare with my database,check if that value in database and then i must show it in form is red color.if the value in text file is 2 then i must show in form green,3 is blue, 4 is white.Help me...
: :
: Use a case statement to set the color. Then show the value.
:
but how to connect to the database?i can show my file text into memo but i can't compare it to the database because i dont know the code
Report
Re: compare value between file text and database Posted by zibadian on 15 Oct 2006 at 9:37 PM
: : : i have a homework...my homework is to read file text, compare with the database and show it up. The problem is that i must show it in form with RGB color...the point is if the value in text file is 1 then i must compare with my database,check if that value in database and then i must show it in form is red color.if the value in text file is 2 then i must show in form green,3 is blue, 4 is white.Help me...
: : :
: : Use a case statement to set the color. Then show the value.
: :
: but how to connect to the database?i can show my file text into memo but i can't compare it to the database because i dont know the code
:
That greatly depends on the database. If it is an SQL database, you'll need some SQL statement like this to get the value from the database:
  'SELECT * FROM table WHERE value = "'+TextValue+'"';

If it is an non-SQL database you need to either iterate through the record using a while-do loop or use the database search algorithms.
If the database is a flat list of objects it might also support a search algorithm or you'll have to again write an iteration routine.
As you can see, without knowing what kind of database it is, it is very difficult to give an answer.
Report
Re: compare value between file text and database Posted by dhenys on 17 Oct 2006 at 1:27 AM
: : : : i have a homework...my homework is to read file text, compare with the database and show it up. The problem is that i must show it in form with RGB color...the point is if the value in text file is 1 then i must compare with my database,check if that value in database and then i must show it in form is red color.if the value in text file is 2 then i must show in form green,3 is blue, 4 is white.Help me...
: : : :
: : : Use a case statement to set the color. Then show the value.
: : :
: : but how to connect to the database?i can show my file text into memo but i can't compare it to the database because i dont know the code
: :
: That greatly depends on the database. If it is an SQL database, you'll need some SQL statement like this to get the value from the database:
:
:   'SELECT * FROM table WHERE value = "'+TextValue+'"';
: 

: If it is an non-SQL database you need to either iterate through the record using a while-do loop or use the database search algorithms.
: If the database is a flat list of objects it might also support a search algorithm or you'll have to again write an iteration routine.
: As you can see, without knowing what kind of database it is, it is very difficult to give an answer.
:
i use delphi database (paradox 7)...i'm very-very new in delphi programming...i never use delphi before...it's my first time i am using delphi...would you help me to understand delphi step by step?
Help me to make connection with my database...




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.