用SQL语句创建Access表
----------------------------------------------------------------------------
类型名称 TYPE 备注
----------------------------------------------------------------------------
自动编号 integer + identity(1,1)
文本 varchar(50) 括号中的数字为文本长度
长整型 integer
整型 short
双精度型 double,float
单精度型 real
字节型 byte
小数 NUMERIC(6,2)
货币 money
备注 text
日期/时间 date,time,datetime
是/否 bit
OLE 对象 OLEObject
----------------------------------------------------------------------------
主键 primary key
必填 not null
默认值 default 当为日期型时为 default date()
-----------------------------------------------------------------------------
示例
表名 字段名 类型 附属属性 说明
------- --------- ------------ --------------------------------- -------------------
create table xc_zh(xczh_id counter(1,1) primary key,
username text,
email text,
homepage text,
title text,
content Memo,
addtime datetime,
ip text,
lastname text,
lasttime datetime,
re_count int,
icon text,
click int);
----------------------------------------------------------------------------------------------------------------------------
创建索引
示例1
create index myindex on mytable (m_class [DESC, ASC], m_int)
示例2
create unique index myindex on mytable (m_class) --创建无重复索引
注意:主键字段会被自动建立为没有重复的索引
如何修改access密码
打开文件后(以'独占方式'打开数据库文件),工具-->安全-->撤销数据库密码;