- Sub wqe()
- '先引用DAO
- Dim mydb As DAO.Database
- Dim mydbe As New DAO.DBEngine'假如 "c:\1.mdb"并不存在。
- Set mydb = mydbe.Workspaces(0).CreateDatabase("C:\1.mdb", _
- DAO.LanguageConstants.dbLangGeneral)Dim mytbl As DAO.TableDef '表对象
- Dim mytablename As String '表名
- Dim myfd As DAO.Field '字段对象Set mytbl = mydb.CreateTableDef("ABC")
- Set myfd = mytbl.CreateField("ID", DAO.DataTypeEnum.dbLong)mytbl.Fields.Append (myfd)
- mydb.TableDefs.Append (mytbl)
- mydb.Close
- End Sub
|