Link to home
Start Free TrialLog in
Avatar of Mestoph
Mestoph

asked on

Table structure updates with CdbObjects

I am trying to build a database dynamically using the
CdbDatabase family of objects.  What I need to do is given
a list of tables and fields, I need to construct the
new tables.  The way I do it is I create the table with
the one field I know will be there, append it, and come
back to it later.  When I do, I am supposed to check to
see if the field exists in the table, and if not, add
the field to the table.  I can, it would seem, determine
if the field exists in the table, but can't add it to
the table, since all I can find for CdbTableDef is the
Create method, and not an Update or anything like it.
Any help would be appreciated.
Avatar of tma050898
tma050898
Flag of United States of America image

I've written a database editor for my current client that allows insurance analysts to graphically create databases. Therefore, I've done what you need to do. However, the current version uses the MFC DAO classes (as opposed to the dbDAO classes). I can send you that code now. If, however, you have already fixed a decision on dbDAO, let me know and I'll send you something tomorrow. The problem is that my original code used dbDAO, but I changed to the MFC DAO classes and now the code using dbDAO is in version control at work. Anyway, lemme know...
Avatar of Mestoph
Mestoph

ASKER

Yeah, if you could send it to me that would be great :)  I don't mind changing to MFC DAO
for this part of it.  I probably won't need to change it for the entire program anyway.  Thanks =)
ASKER CERTIFIED SOLUTION
Avatar of tma050898
tma050898
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial