分类：电脑/网络-程序设计-数据库
问题：vb中怎样创建数据表?在vb中用createtable创建数据表 
在vb中用create tae创建数据表
回答：建议用dao完成Dim tdfnewtae As TableDefDim fldnewfield As Field'创建数据表Set tdfnewtable = dbs.CreateTableDef(tabname)'创建表中字段With tdfnewtable.Fields.Append .CreateField("名称", dbText, 50).Fields.Append .CreateField("数量", dbLong)End Withdbs.TableDefs.Append tdfnewtabledbs.TableDefs.Refresh或者：Dim connstr As StringDim dbconn As New ADODB.ConnectionDim Ctb As StringCtb = "create table tempjian(userlist varchar(30))"connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Password=NewPassword;Data Source=NewDB.mdb;Persist Security Info=True"dbconn.Open connstrdbconn.Execute Ctb