Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Record Type declaration in code at run-time?

Status
Not open for further replies.

corsair2

IS-IT--Management
Feb 21, 2001
55
GB
I'm interested in creating database tables at run-time based on information supplied by the user.
Now, I've used the on-line tutorials I've found and they've been very useful and informative BUT!...
The requirements for creating the Db tables have altered (my boss changed his mind again...) and I now think they can be most easily filled if I can figure out a way to use a record type with a variant part.
Trouble is, I don't know if its' even possible to create the Record Type declaration at run-time.
Can anyone save my sanity?[elephant2]

regards

Steve
 
Steve,

I don't believe it's possible to declare a record type at runtime, at least not a RECORD type.

You can, however, create tables at runtime. Thus, one way to do this might be to create a "details" detail table linked to the master record, one that maps custom "fields" as records in a detail table.

Hope this helps...

-- Lance
 
Hi Steve,

Variant records still require a declaration so you have to know something abot the field structure in advance.

I have tackled similar problems to yours by using "pseudo" tables aka flat files. However, even here you need to have a reasonable idea of how big a record might be because your "variant" record must have enough room to be represented. Invariably you have a flat file structure with a lot of in-built padding to allow for field changes. To control this you have to build some structures which approximate the "field by name" access features of Delphi

Roger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top