VB.net System.Data.OleDb.OleDbException: '语法错误(缺少运算符)

VB.net System.Data.OleDb.OleDbException: 'Syntax error (missing operator)

我在 Visual studio 2017 年使用 Access 2013 作为数据库。数据库已连接,但当我 运行 此代码时:

myConnToAccess = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Database11.accdb")
    myConnToAccess.Open()
    ds = New DataSet
    tables = ds.Tables
    da = New OleDbDataAdapter("SELECT Typ záznamu from Typ", myConnToAccess)
    da.Fill(ds, "Typ")
    Dim view1 As New DataView(tables(0))
    With ComboBox1
        .DataSource = ds.Tables("Typ")
        .DisplayMember = "Typ záznamu"
        .ValueMember = "Typ záznamu"
        .SelectedIndex = 0
        .AutoCompleteMode = AutoCompleteMode.SuggestAppend
        .AutoCompleteSource = AutoCompleteSource.ListItems
    End With

我收到 **System.Data.OleDb.OleDbException:“查询表达式 'Typ záznamu' 中存在语法错误(缺少运算符)。” **

我有

Dim mySQLCommand As OleDbCommand
Dim mySQLStrg As String
Dim ds As DataSet
Dim da As OleDbDataAdapter
Dim tables As DataTableCollection
Dim myConnToAccess As OleDbConnection

在 class... 的开头还有:

Imports System.Data.OleDb

我不知道该做什么了...有人可以帮我吗?

如果要查询Typ záznamu列,则需要将其放在方括号中,因为单词之间有space

da = New OleDbDataAdapter("SELECT [Typ záznamu] from Typ", myConnToAccess)

我成功了:

这一行:

da = New OleDbDataAdapter("SELECT Typ záznamu from Typ", myConnToAccess)

需要看起来像这样:

 da = New OleDbDataAdapter("SELECT [Typ záznamu] from Typ", myConnToAccess)

唯一的区别在于列名。它需要在正方形的 breaces 中或者你怎么称呼它 [ ]