1

I am using delphi 7

I want my system to have an option to change the color of say a panel and when the user closes the program and opens it again, the color should still be there.

Is there a way to save the new color in an sql column and when the programs oncreate procedure fires, it will get the color desired from the sql field.

If this is possible, how?

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Issyy Moola
  • 137
  • 3
  • 13
  • What exactly are you asking? How to store in a db field. What data type it should have? how to do the whole thing? – juergen d Sep 18 '13 at 08:23
  • How to store it into a db field and how to retrieve the color – Issyy Moola Sep 18 '13 at 08:29
  • 1
    Question is, how can you represent a color in terms of `INT`, `BLOB`, `VARCHAR`, that is to say, in a SQL type. How do you construct a color in your code? – RandomSeed Sep 18 '13 at 08:32

1 Answers1

6

The Color of the components in Delphi are represented by the TColor type (TColor = -$7FFFFFFF-1..$7FFFFFFF) which can represented by an Integer. So only you need create a INT Column in your MySQL table and to set and get the value. If you are new accessing MySQL from Delphi , you can try the answer to this question Delphi 7: ADO, need basic coding example

Community
  • 1
  • 1
RRUZ
  • 134,889
  • 20
  • 356
  • 483