加上default就行了,举例如下:
Dim conn1 As ADODB.Connection
Dim Rs As ADODB.Recordset
Dim SQLStr As String, SQLCreate As String, SQLAlter As String
SQLStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\abc.mdb;"
Set conn1 = New ADODB.Connection
conn1.ConnectionString = SQLStr
conn1.Open
SQLCreate = "create table " & Trim(Text1.Text) & _
"(H_ID int not null, english char(30) not null default ENG," & _
"chinese char(50) not null default CHN)"
SQLAlter = "Alter table " & Trim(Text1.Text) & _
" add primary key (H_ID)"
Set Rs = conn1.Execute(SQLCreate, 1, adCmdText)
Set Rs = Nothing
Set Rs = conn1.Execute(SQLAlter, 1, adCmdText)
Set Rs = Nothing
Dim conn1 As ADODB.Connection
Dim Rs As ADODB.Recordset
Dim SQLStr As String, SQLCreate As String, SQLAlter As String
SQLStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\abc.mdb;"
Set conn1 = New ADODB.Connection
conn1.ConnectionString = SQLStr
conn1.Open
SQLCreate = "create table " & Trim(Text1.Text) & _
"(H_ID int not null, english char(30) not null default ENG," & _
"chinese char(50) not null default CHN)"
SQLAlter = "Alter table " & Trim(Text1.Text) & _
" add primary key (H_ID)"
Set Rs = conn1.Execute(SQLCreate, 1, adCmdText)
Set Rs = Nothing
Set Rs = conn1.Execute(SQLAlter, 1, adCmdText)
Set Rs = Nothing
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货