对象Refresh的方法IAdodc失败
PrivateSubTreeView1_NodeClick(ByValNodeAsMSComctlLib.Node)DimtempAsStringDimTree_Node...
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Dim temp As String
Dim Tree_Node As String
Dim rstemp As New ADODB.Recordset
Tree_Node = TreeView1.SelectedItem.Key
If Tree_Node = "设备分类" Then
Adodc2.RecordSource = "select * from View_sbfl"
Adodc2.Refresh
Else
Ado_temp.RecordSource = "select * from View_sbfl where 设备类别='" + Tree_Node + "'"
Ado_temp.Refresh
Adodc2.RecordSource = "select * from View_sbfl where 设备类别='" + Tree_Node + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
DataGrid1.Refresh
ElseIf Adodc2.Recordset.RecordCount = 0 Then
Adodc2.RecordSource = "select * from View_sbfl where 设备名称='" + Tree_Node + "'"
Adodc2.Refresh
Ado_temp.RecordSource = "select * from View_sbfl where 设备名称='" + Tree_Node + "'"
Ado_temp.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
temp = Adodc2.Recordset.Fields("设备类别")
Ado_temp.RecordSource = "select * from View_sbfl where 设备类别='" + temp + "'"
Ado_temp.Refresh
Set DataGrid1.DataSource = Ado_temp
End If
End If
End If
End Sub
Adodc的数据源已经指定过。错误提示是Ado_temp至少一个参数没有被指定值,还有对象Refresh的方法IAdodc失败。求指点!谢谢。 展开
Dim temp As String
Dim Tree_Node As String
Dim rstemp As New ADODB.Recordset
Tree_Node = TreeView1.SelectedItem.Key
If Tree_Node = "设备分类" Then
Adodc2.RecordSource = "select * from View_sbfl"
Adodc2.Refresh
Else
Ado_temp.RecordSource = "select * from View_sbfl where 设备类别='" + Tree_Node + "'"
Ado_temp.Refresh
Adodc2.RecordSource = "select * from View_sbfl where 设备类别='" + Tree_Node + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
DataGrid1.Refresh
ElseIf Adodc2.Recordset.RecordCount = 0 Then
Adodc2.RecordSource = "select * from View_sbfl where 设备名称='" + Tree_Node + "'"
Adodc2.Refresh
Ado_temp.RecordSource = "select * from View_sbfl where 设备名称='" + Tree_Node + "'"
Ado_temp.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
temp = Adodc2.Recordset.Fields("设备类别")
Ado_temp.RecordSource = "select * from View_sbfl where 设备类别='" + temp + "'"
Ado_temp.Refresh
Set DataGrid1.DataSource = Ado_temp
End If
End If
End If
End Sub
Adodc的数据源已经指定过。错误提示是Ado_temp至少一个参数没有被指定值,还有对象Refresh的方法IAdodc失败。求指点!谢谢。 展开
2个回答
展开全部
1. temp可能有空值吧
2. 设置属性commandType=adcmdtext,或许refresh没问题了。
2. 设置属性commandType=adcmdtext,或许refresh没问题了。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询