Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

compare value between file text and database

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...

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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.
  • dhenysdhenys Posts: 3Member
    : : 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
  • zibadianzibadian Posts: 6,349Member
    : : : 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:
    [code]
    'SELECT * FROM table WHERE value = "'+TextValue+'"';
    [/code]
    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.
  • dhenysdhenys Posts: 3Member
    : : : : 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:
    : [code]
    : 'SELECT * FROM table WHERE value = "'+TextValue+'"';
    : [/code]
    : 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...

Sign In or Register to comment.