1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| MColumn4 := CoColumn.Create;
with MColumn4 do
begin
ParentCatalog := Catalog;
Name := 'Column4';
Type_ := adLongVarWChar;
Properties['Default'].Value := 'http://www.borland.com/delphi';
procedure CreateAndAppendNewColumn;
// Modifying column properties is so problematic that usually you're better
// of deleting the old column and appending a new one to a table's
// existing Columns collection.
begin
MColumn7 := CoColumn.Create;
with MColumn7 do
begin
ParentCatalog := Catalog;
Name := 'Column7';
Type_ := adDouble;
// A bug in ADO 2.5 means that the Default property value will not be
// accepted and no error will be given. This bug is not in 2.1 or 2.6.
Properties['Default'].Value := 0;
end;
MTable.Columns.Append(MColumn7, Unassigned, Unassigned);
end; |
Partager