Re: Create Database in MS Access. & set properties of fields.



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

.



Relevant Pages

  • Re: Batchmove & ADO
    ... Brian Bushay TeamB wrote: ... I have a TService which currently uses a datamodule plus several TBatchmove components to move data from a SQL Server Database -> Oracle database. ...
    (borland.public.delphi.database.ado)
  • Re: username
    ... Try double clicking on the TADOConnection, this will open a dialog box, ... Click on build and there you can enter user name, password, database an so ... "Brian Bushay TeamB" wrote in message ...
    (borland.public.delphi.database.ado)
  • Re: strategy for record locking in multiuser environment
    ... I am using an Access 2000 database ... "Brian Bushay TeamB" wrote in message ... >>overwrite another users entries and so each user can see the changes or ...
    (borland.public.delphi.database.ado)
  • RE: dbgrid refreshing problems...
    ... Brian Bushay TeamB escribió en el mensaje de noticias ... > reload records from the database. ...
    (borland.public.delphi.database.ado)
  • Re: Cache Size and AsyncFetch
    ... Brian Bushay TeamB wrote: ... form set with the tables via an ADOConnection. ... Asnyc fetching is incompatible with serverside cursors and also with Delphi data ...
    (borland.public.delphi.database.ado)