主题:请教运行代码的修改
先生您好,我想在SY.MDB的表B1中自动增加列,但运行代码后没有反应,请指点,谢谢
代码如下
Private Sub form_load()
Me.WindowState = 2
Dim Conn As New ADODB.Connection
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\sy.mdb"
Conn.Execute "delete * from B1"
End Sub
Private Sub Command1_Click()
For i = 2 To 100
alter tabel SY.mdb add column "列" + Trim(Str(i)) long
Next i
End Sub
代码如下
Private Sub form_load()
Me.WindowState = 2
Dim Conn As New ADODB.Connection
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\sy.mdb"
Conn.Execute "delete * from B1"
End Sub
Private Sub Command1_Click()
For i = 2 To 100
alter tabel SY.mdb add column "列" + Trim(Str(i)) long
Next i
End Sub