 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
MikeR Guest
|
Posted: Mon Apr 30, 2007 7:50 am Post subject: Change field property |
|
|
I need to change a field in an existing Access 2000 db to allow zero length. The
following doesn't error, but it doesn't change the property either. Google turned up
tons of hits, but no working solution.
Thanks, Mike
procedure TForm1.Button1Click(Sender: TObject);
var
sql: string;
cat: _Catalog;
col : _Column;
table : _Table;
I,j: Integer;
cstr: string;
fName: olevariant;
begin
sql := 'ALTER TABLE [Log] ALTER COLUMN R_RST text(3)';
conn.Execute(sql);
conn.Close;
{ The above uses ADO to change the type from number to text.
Now change a property.}
cStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + DBName + ';Jet
OLEDB:Engine Type=5';
cat := CoCatalog.Create;
cat._Set_ActiveConnection(cStr);
table := CoTable.Create;
table := cat.Tables['Log'];
col := CoColumn.Create;
Col.ParentCatalog := cat;
fname := 'R_RST';
Col.Name := fName;
Col.Properties['Jet OLEDB:Allow Zero Length'].Value := true; |
|
| Back to top |
|
 |
MikeR Guest
|
Posted: Mon Apr 30, 2007 11:54 pm Post subject: Re: Change field property |
|
|
Never mind. I was finally able to get into CodeCentral, and found the answer there.
Mike |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|