① VB创建多个sql表
SQL语句如下:
可以同时创建两个表
CREATETABLE[dbo].[tb_b_Language]([LanguageID][tinyint]NOTNULL,[LanguageName][varchar](20)NOTNULL)ON[PRIMARY];CREATETABLE[dbo].[tb_b_Menu]([MenuID][smallint]NOTNULL,[MenuName][varchar](50)NOTNULL,[MenuType][tinyint]NOTNULL,[ParentMenuID][smallint]NULL,[OrderNum][smallint]NOTNULL,[IsDisplay][tinyint]NOTNULL)ON[PRIMARY]
② vb 用SQL创建ACCESS多表语句
Dim
DefDatabase
As
Database
Dim
PathName
As
String
Dim
conn
Dim
sql
As
String
PathName
=
App.Path
Set
DefDatabase
=
CreateDatabase(PathName
+
"\db.mdb",
dbLangGeneral)
DefDatabase.Close
Set
conn
=
CreateObject("ADODB.Connection")
conn.Open
"provider=microsoft.jet.oledb.4.0;data
source="
&
PathName
+
"\db.mdb"
sql
=
"create
table
MyTable
(
编号
autoincrement(1,1)
,
姓名
varchar(50)
,
constraint
pk_test_id
primary
key(编号))"
conn.Execute
sql
'-------重复以下这里就可以了
sql
=
"create
table
MyTable2
(
编号
autoincrement(1,1)
,
姓名
varchar(50)
,
constraint
pk_test_id
primary
key(编号))"
conn.Execute
sql
'-------重复以上代码
MsgBox
"创表成功"
③ vb 中使用sql语句创建表结构
SQL语法的问题