|
- Dim Va_Rec As New ADODB.Recordset
- Dim Va_i01 As Integer
- [color=Red]Va_Rec.Open "查询表", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect[/color]
- For Va_i01 = 0 To Va_Rec.RecordCount - 1
- Set oNode = .Add(Va_Rec.Fields("B_SSDepID"), tvwChild, Va_Rec.Fields("B_DepID"), Va_Rec.Fields("T_Dep"))
- Va_Rec.MoveNext
- Next Va_i01
- Va_Rec.Close
复制代码
Va_Rec.Open "查询表", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
如果查询中没有筛选条件,运行正常,但如果加上筛选条件(因为我只需要引用部份数据,所以想加个过滤条件),就出现“运行时错误 -2147217904(80040e10),参数不足,期待值是1”,这是为什么? |
|