【求助】关于利用SQL查询数据库
小弟用SQL连接数据库时碰到一麻烦问题,请高手解答。以下是代码: Dim db As New ADODB.Connection Dim rs As New ADODB.Recordset Dim str As String Dim sSQL As String Set db = New ADODB.Connection Set rs = New ADODB.Recordset
str = " Provider = Microsoft.Jet.OLEDB.3.51;Data Source=E:\.....\大气扩散.mdb" db.ConnectionString = str db.Open rs.CursorLocation = adUseClient sSQL = "select * from 有风初始参数 where 污染源名称 = '石洞口电厂'" rs.Open sSQL, db, adOpenStatic, adLockReadOnly Set DataGrid1.DataSource = rs 运行后显示:“实时错误:’2147217900( 80040e14) 语法错误 (操作符丢失) 在查询表达式 ‘污染源名称 = ’石洞口电厂‘’中” 请问该如何解决?不胜感激!