|
Sub 连接数据库01()
Dim conn As ADODB.Connection
Dim conn1 As New ADODB.Connection
Set conn = New ADODB.Connection
'Set conn1 = New ADODB.Connection
conn.Open "provider=microsoft.ace.oledb.12.0;data source=" & ThisWorkbook.Path & "\学生管理.accdb"
'
'conn1.Open "provider=microsoft.ace.oledb.12.0;extended properties=excel 8.0;data source=" & ThisWorkbook.Path & "\数据.xlsx"
Dim spl As String
spl = "insert into 1(院系号,院系名,电话)value('A001','经管系','666')"
conn.Execute (spl)'运行到这里总是报错:说insert into 语句语法错误
conn.Close
Set conn = Nothing
End Sub
请各位老师给小弟指点,
|
|