关于数据库的问题!!objAdap.Fill(objDSet, strSql)出错。
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChangedDim Zhijin As String
Zhijin = ""
Zhijin = ComboBox1.Text
Dim strConn As String = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = 铁心参数.mdb"
Dim objConn As New OleDbConnection(strConn)
objConn.Open()
Dim strSql = "Select * From 表1 where 铁心直径 = " + Zhijin
Dim objAdap As New OleDbDataAdapter(strSql, objConn)
objConn.Close()
Dim objDSet As New DataSet
objAdap.Fill(objDSet, strSql)
TextBox1.Text = objDSet.Tables(0).Rows(0)("第1级片宽")
TextBox2.Text = objDSet.Tables(0).Rows(0)("第2级片宽")
TextBox8.Text = objDSet.Tables(0).Rows(0)("第1级叠厚")
TextBox9.Text = objDSet.Tables(0).Rows(0)("第2级叠厚")
End Sub
当关闭窗口时出现错误,在objAdap.Fill(objDSet, strSql)这一句标成黄色,说是未处理OleDbException,语法错误 (操作符丢失) 在查询表达式 '铁心直径 =' 中。
这种问题怎么解决? (用VB.ENT编程)