vb+sql查询问题,急急急!!!!
If Combo2.Text = "like" Then
Adodc1.RecordSource = "select * from 图书信息 where 图书信息." & Combo1.Text & " like + '%" + Text1.Text + "%'"
Adodc1.Refresh这句总显示有问题,求解
Else
链接数据库的代码:
Public xh As String
Public i As Integer
Public Function mysql() As String
mysql = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Password=;Initial Catalog=图书管理系统"
End Function
Public Function cnn() As ADODB.Connection '定义函数
Set cnn = New ADODB.Connection
'返回一个数据库连接
cnn.Open "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Password=111;Initial Catalog=图书管理系统"
End Function
[解决办法]
like + '%" 弄一个加号干嘛?
==>
like '%"