求教vb关于数据库连接问题!急!我在线等!
以下我编的一段代码请问为啥在 MSHFlexGrid1控件中没有内容显示!数据库肯定是连上了!Private Sub Command1_Click()
Dim stro1 As String
stro1 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=111;Data Source=P08"
Adodc1.ConnectionString = stro1
Dim strSQL As String
strSQL = "select * from 项目计划表 where 项目编号 LIKE '" & Trim(Text1) & " % 'or 项目名称 LIKE '" & Trim(Text2) & " % '"
= adCmdText
Adodc1.RecordSource = strSQL
Adodc1.Refresh
Set MSHFlexGrid1.DataMember = Adodc1.Recordset '使用的是MSHFlexGrid1控件,不是datagrid
MSHFlexGrid1.Refresh
End Sub