Select 在 word 2010 中访问数据库

Select acces datatbase in word 2010

我必须 select 来自 word 2010 in vba 中的访问的一些行,现在我想 select 一些东西但是我得到一个错误,说我的 Select错了你能帮我吗?

Private Sub CommandButton1_Click()
Dim jahr As String
Dim LfdNummer As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSql As String
jahr = TextBox1
LfdNummer = TextBox2




Private Sub CommandButton1_Click()
Dim jahr As String
Dim LfdNummer As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSql As String
jahr = TextBox1
LfdNummer = TextBox2




Set db = CreateObject("DAO.DBEngine.120").OpenDatabase("C:\User/012886\Documents\Hendrik\trilux\EMV\Beispiel_EMV.accdb")

' Daten lesen und weiterverwenden -> über Recordset

Set rs = db.OpenRecordset("SELECT * FROM ITZ-EMV-Messungen")
Do While Not rs.EOF

  rs.MoveNext
Loop


 rs.Close
 db.Close

End Sub

试试包围曝光:[ITZ-EMV-Messungen] 我估计是破折号。