Re: Create Database in MS Access. & set properties of fields.
- From: "BB" <shmilyca@xxxxxxxxx>
- Date: 29 Nov 2006 11:01:21 -0800
ok..Thank you..Appriciate your help.
Brian Bushay TeamB wrote:
I am creating new database in MS Access runtime using Delphi. I
know how to create database but I want to add few things when I create
new field
I want to add its default value, I want to set that field
"Required" to No. Also I want to "Allow Zero Length" to yes when I
create it.
Any idea how to do it? I am also using FireBird 2.0. Can I do
samethings in firebird too?
You can handle Required when you create a table with SQL using the
Null or Not Null directive. Or just leave it out and the default is NULL
CREATE TABLE tblCustomers (CustomerID INTEGER NOT NULL,
[Last Name] TEXT(50) NOT NULL,
[First Name] TEXT(50) NOT NULL,
Phone TEXT(10),
Email TEXT(50))
Access is the only database I know that supports the Allow Zero length property.
This can only be set using Microsoft ADOX
If you import the microsoft type library you can use code like this to change
that property
var
Catalog1. : Catalog;
begin
Catalog1. := CoCatalog.Create;
Catalog1._Set_ActiveConnection(ADOConnection1.ConnectionObject);
Catalog1.Tables['TheTableName'].Columns['TheColumName'].Properties['Jet
OLEDB:Allow Zero Length'].Value = True;
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
- References:
- Re: Create Database in MS Access. & set properties of fields.
- From: Brian Bushay TeamB
- Re: Create Database in MS Access. & set properties of fields.
- Prev by Date: Re: Bizarre slowdown in updating Access table
- Next by Date: Re: Bizarre slowdown in updating Access table
- Previous by thread: Re: Create Database in MS Access. & set properties of fields.
- Next by thread: Re: Bizarre slowdown in updating Access table
- Index(es):
Relevant Pages
|