Color dialog box and MS Access
I am making an application for a powder coating company. I need to provide the user with the facility of selecting a color and save the color into the database and retrieve when required. Please tell me guys how can i do that?
database name: database.mdb
Secondly, I also wanted to know that is it necessary to have primary keys in Access database? I haven't assigned any primary key and haven't felt the need yet.
Re: Color dialog box and MS Access
You will find examples plus other useful information that may be of use in the Database Development FAQ.
Re: Color dialog box and MS Access
I didn't find anything relevant to my post. Nor did I found anything that would help me to solve my query. Can't you post an 'answer' or 'solution' rather than links?
Re: Color dialog box and MS Access
The articles in the DB FAQs show you how to save data to a database and get it back again, which is part of your question.
In terms of selecting a colour, I recommend using the Common Dialog control (add it to your program via "Project"->"Components").
Quote:
Secondly, I also wanted to know that is it necessary to have primary keys in Access database? I haven't assigned any primary key and haven't felt the need yet.
Primary keys are not essential, but as a general guideline you should only leave them out if you are certain that they will cause problems for that particular table.
There are various reasons why Primary Keys are a good idea, the main one being that they remove the possibility of having "bad" duplicate data. With PK's you cannot accidentally create two identical records (which you then can't edit/delete uniquely, you have to work with both), or two records that contain data the same data for the PK (which would indicate you have designed the table(s) or PK badly).
You can find more details in the many different articles/books that explain what a PK is.
Re: Color dialog box and MS Access
Quote:
Originally Posted by
si_the_geek
The articles in the DB FAQs show you how to save data to a database and get it back again, which is part of your question.
In terms of selecting a colour, I recommend using the Common Dialog control (add it to your program via "Project"->"Components").
But Sir, how do I save it in the database? I guess there is no type color in access.
Re: Color dialog box and MS Access
VB doesn't have a colour type either, it just uses Long (occasionally with an alias such as OLE_COLOR, but still a Long).
Re: Color dialog box and MS Access
Quote:
Originally Posted by
si_the_geek
In terms of selecting a colour, I recommend using the Common Dialog control (add it to your program via "Project"->"Components").
mstrmnd could also use the api posted here if he doesn't want to use a bulky control.