vb用adodc 和 grid控价连接access查询语句报错Adodc1.Recordset.Open strsql
PrivateSubCommand8_Click()DimstrsqlAsStringIfText9.Text<>""ThenAdodc1.Recordset.Close...
Private Sub Command8_Click()
Dim strsql As String
If Text9.Text <> "" Then
Adodc1.Recordset.Close
MSHFlexGrid1.Clear
strsql = "select * from biao1 where 姓名='" & Trim(Text9.Text) & "'"
Adodc1.CommandType = adCmdText
Adodc1.Recordset.Open strsql
Adodc1.Refresh
Set MSHFlexGrid1.DataSource = Adodc1
Else
Set MSHFlexGrid1.DataSource = Nothing
End If
End Sub 展开
Dim strsql As String
If Text9.Text <> "" Then
Adodc1.Recordset.Close
MSHFlexGrid1.Clear
strsql = "select * from biao1 where 姓名='" & Trim(Text9.Text) & "'"
Adodc1.CommandType = adCmdText
Adodc1.Recordset.Open strsql
Adodc1.Refresh
Set MSHFlexGrid1.DataSource = Adodc1
Else
Set MSHFlexGrid1.DataSource = Nothing
End If
End Sub 展开
1个回答
展开全部
Private Sub Command8_Click()
Dim strsql As String
If Text9.Text <> "" Then
'Adodc1.Recordset.Close
MSHFlexGrid1.Clear
strsql = "select * from biao1 where 姓名='" & Trim(Text9.Text) & "'"
Adodc1.CommandType = adCmdText
'Adodc1.Recordset.Open strsql
Adodc1.RecordSource = strsql
Adodc1.Refresh
Set MSHFlexGrid1.DataSource = Adodc1
Else
Set MSHFlexGrid1.DataSource = Nothing
End If
End Sub
启帆信息
2024-11-19 广告
2024-11-19 广告
启帆信息是英伟达中国区代理商,原厂授权代理,提供全面的软件技术解决方案以及NVIDIA以太网产品、交换机等产品,欢迎前来咨询!...
点击进入详情页
本回答由启帆信息提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询