用alter这个SQL命令比如你要添加一个username字段到表member 那这个就要写成alter table member add username text;member是表名 add是添加一个新字段 username 是字段名 text 是字段类型
第2个回答 2013-07-26
Dim strAppPath As String Dim constr As String Set cnn = New ADODB.Connection Set rs = New ADODB.Recordset strAppPath = App.Path If Right(strAppPath, 1) <> "\" Then strAppPath = strAppPath & "\" End If strAppPath = strAppPath & "db1.mdb" constr = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & strAppPath & "" cnn.Open constr Dim str As String str = "alter table 表名 add 字段 类型" rs.Open str, cnn, adOpenStatic msgbox"添加字段成功",vbokonly
第3个回答 2013-07-26
SQL 语句的 ALTER TABLE 指令. ---------- [语法]: ALTER TABLE 表 {ADD ADD{COLUMN 字段类型 [ (字长)] [NOT NULL] [CONSTRAINT 索引 ] | ALTER COLUMN 字段类型 [(字长)] | CONSTRAINT 多重字段索引 } | DROP DROP{COLUMN 字段 I CONSTRAINT 索引名 } }ALTER TABLE 语句分为以下几个部分:部分 说明 table 欲修改的表之名称。 field 欲在表内增加或删除的字段的名称。或表内欲被替换的字段名称。 type 字段的数据类型。 size 字段的字符长度 (文本及二进制字段)。 index 字段索引。欲了解更多有关如何构造本索引的信息,请看 CONSTRAINT子句。 multifieldindex 欲增加至表 中的多重字段索引的定义。欲了解更多有关如何构造本索引的信息,请看 CONSTRAINT子句。 indexname 欲删除的多重字段索引的名称。本回答被网友采纳