注册 登录
编程论坛 SQL Server论坛

有关查询语句的问题

wzleagle 发布于 2014-06-21 12:17, 529 次点击
这是我写的查询语句,总是出现from语句错误,想让大家帮忙看看
Private Sub find_Click()
  If Text1.Text = "" Then
    MsgBox "请输入编码", vbCritical, "提示"
    Text1.Text = ""
Else
    Adodc1.RecordSource = "select * from 数据表 where 编号 = '&Text1.Text& '"
    Adodc1.Refresh
    End If
   
End Sub
3 回复
#2
tlliqi2014-06-21 18:12
'& Text1.Text &'
Text1.Text前后加空格 看看行不
#3
volte2014-06-24 09:26
引号用了中文符号
#4
Artless2014-06-24 11:25
Private Sub find_Click()
   If Text1.Text = "" Then
     MsgBox "请输入编码", vbCritical, "提示"
 Else
     Adodc1.RecordSource = "select * from 数据表 where 编号 = '" & Text1.Text & "'"
     Adodc1.Refresh
     End If
     
 End Sub
1