Home > Database > Mysql Tutorial > 在Access中创建表及如何指定字段类型

在Access中创建表及如何指定字段类型

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:16:33
Original
1162 people have browsed it

在access中 创建 表一般是用ADO来执行SQL语句来 创建 表。Access中的 字段 类型 在SQL语句中是什么呢?在MSDN中有篇文章介绍得很详细: http://msdn.microsoft.com/office/understanding/access/codesamples/default.aspx?pull=/library/en-us/dnacc2k/html/

在access中创建表一般是用ADO来执行SQL语句来创建表。Access中的字段类型在SQL语句中是什么呢?在MSDN中有篇文章介绍得很详细:
http://msdn.microsoft.com/office/understanding/access/codesamples/default.aspx?pull=/library/en-us/dnacc2k/html/acintsql.asp

下面是我写的一个SQL语句,在Delphi中用ADOConnection对象执行成功:
CREATE TABLE 测试表 (
   文本255 VARCHAR NOT NULL, 
  文本20 VARCHAR(20) NOT NULL, 
   日期时间 DATETIME, 
   数字1 BYTE, 
   数字2 SMALLINT, 
   数字4 INTEGER, 
   布尔 BIT,
   自动编号 COUNTER(10, 5) CONSTRAINT PK_TVipLevel26 PRIMARY KEY,
   小数 NUMERIC,
   单精度 REAL,
   双精度 FLOAT DEFAULT 0 NOT NULL,
   备注 MEMO,
   货币 CURRENCY,
   OLE对象 IMAGE)

在Access的查询设计器中,该语句不能执行DEFAULT 0;
其中:COUNTER(10,5)表明初始值从10开始,每次递增5,如果没有(10,5),则是从1开始,每次递增1;
NUMERIC表示小数,可以用NUMERIC(18,2)指定有2位小数;

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Access error using alias
From 1970-01-01 08:00:00
0
0
0
Single module access
From 1970-01-01 08:00:00
0
0
0
About Mac MAMP PRO deploy thinkphp5.1 access 404
From 1970-01-01 08:00:00
0
0
0
My access page reports 403
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template