Board index » delphi » Change Size and Type of field

Change Size and Type of field

Hello everybody,

I use MS Access database in Delphi 3.
How can I change the size (physical size of the field) and the type of a
field in the run-time?
Example 1:
    MyTable.Open;
    MyTable.Fields[0].Size;
I get an error "Can not in open database"
Example 2:
    MyTable.Close;
    MyTable.Fields[0].Size;
I get an error "List-index out of range"
Thanks,

 

Re:Change Size and Type of field


You have to use ALTER TABEL and ExecSQL for this.

Look at your manuals and helpfiles.

Rudy
==================================
Mehran Ehteshami schreef:

Quote

> Hello everybody,

> I use MS Access database in Delphi 3.
> How can I change the size (physical size of the field) and the type of a
> field in the run-time?
> Example 1:
>     MyTable.Open;
>     MyTable.Fields[0].Size;
> I get an error "Can not in open database"
> Example 2:
>     MyTable.Close;
>     MyTable.Fields[0].Size;
> I get an error "List-index out of range"
> Thanks,

Other Threads