Access from Excel using ADO
I assume you are using DDL statements i.e. CREATE TABLE. Therefore,
1. The Autonumber ('IDENTITY' in SQL Server) is evil, avoid using it.
But if you must, the keyword is IDENTITY(1,1) - it is for Jet 4.0,
anyhow.
2. It is good practise to always use either NULL or NOT NULL, even
though NULL is the default.
Here's an example:
CREATE TABLE PersonalDetails (
RefID IDENTITY(1,1) PRIMARY KEY,
Name VARCHAR(35) NOT NULL UNIQUE,
Description VARCHAR(50) NULL
)
--
"Raj" wrote in message ...
Hello, please help if you can.
I am using ADO to add data from Excel to an Access
Database. I am successful so far. I only need to add two
things:
1. How can I add an "AutoNumber" column using ADO?
2. When adding fields to a table, how can I tell Access
that the field may be null (equivalent to
setting "Required" to no) using ADO?
Your example code would be most appreciated. Thanks in
advance for your assistance.
|