access归档, 就SQL语句, 本人就搞了三四天才有头绪 。
Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnectionString
objConnection.Open
If (objConnection.State = 0) Then
MsgBox "连接数据库失败!"
End If
Set objCommand = CreateObject("ADODB.Command")
With objCommand
.ActiveConnection = objConnection
.CommandText = strSQL
End With
objCommand.Execute
MsgBox (Err.Number)
If Err.Number = 0 Then
MsgBox "执行插入成功"
Else
MsgBox "执行插入失败"
End If
Set objCommand = Nothing
objConnection.Close
Set objConnection = Nothing