<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I would consider having a generic table
where you soft-add the fields<br>
<br>
Ref_Num : autoinc<br>
Owner_Num : int64<br>
Field_Name : string (16)<br>
Field_Type : integer // ord(TFieldType)<br>
Field_Data : string (255) // store everything as string but the
type above tells you what it is<br>
<br>
This way you dont alter the database. You dont have to worry
about indexes etc. Everyones database is the same. Yet you can
search for data for a particular field name. I am actually using
this structure in a three projects.<br>
<br>
Regards<br>
<br>
Rohit<br>
<br>
On 6/03/2013 10:41 a.m., Steve Peacocke wrote:<br>
</div>
<blockquote
cite="mid:CAH2ZicX=zM5DSoFST7TijtQQhjhaOwBG--_Bf9NhCzf2ueObkQ@mail.gmail.com"
type="cite">
<pre wrap="">Hi everyone,
I've been away from programming for a while so please excuse the
seemingly simple question.
I'm designing a user interface for a new application and wondered if
there was a generally accepted way that this "should" be done.
The application will allow end users to edit their forms allowing them
to add, move, and remove fields at runtime. I'm using MySQL but I was
wondering if there was an accepted way of adding and changing fields
to a database.
I know I can use SQL for this but I also don't want to make every
application unable to be managed or upgraded. Perhaps I can ensure
that the 3-4 permanent fields are never able to be altered (ID, Name,
etc) but allow the user (through a suitable user-friendly interface)
to go crazy adding such fields as My_favourite_colour, Rating,
Priority, Notes, etc. etc.
I'm able to give a suitable user-friendly interface to allow them to
physically alter the Delphi form at runtime, but wondered about the
"most appropriate way" to modify the fields to the database.
1. I could simply add fields using SQL's ALTER TABLE
2. I could add another table with fields such as TableName, FieldName,
Type, etc.. and add to that
3. Some other spiffy way that you people will suggest that I haven't
even thought of yet.
Any suggestions?
Steve Peacocke
+64 220 612-611
<a class="moz-txt-link-freetext" href="http://www.nzorient.co.nz">http://www.nzorient.co.nz</a>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe
__________ Information from ESET Endpoint Antivirus, version of virus signature database 8081 (20130305) __________
The message was checked by ESET Endpoint Antivirus.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
Regards<br>
<br>
<b>Rohit Gupta</b><br>
B.E. Elec., M.E., Mem IEEE, Member IET<br>
Technical Director<br>
Computer Fanatics Ltd<br>
<br>
<b>Tel </b>4892280 <br>
<b>Fax </b>4892290 <br>
<b>Web </b><a href="www.cfl.co.nz">www.cfl.co.nz</a><br>
<hr>
This email and any attachments contain information, which is
confidential and may be subject to legal privilege and copyright.
If you are not the intended recipient, you must not use,
distribute or copy this email or attachments. If you have received
this in error, please notify us immediately by return email and
then delete this email and any attachments.</div>
</body>
</html>