VB查询数据库问题...很简单,高手帮忙
过程"采购退货单"的请求失败,因为"采购退货单"是表对象注:采购退货单为数据库名称下面是代码:PrivateSubCommand1_Click()OnErrorResum...
过程"采购退货单"的请求失败,因为"采购退货单"是表对象
注:采购退货单为数据库名称
下面是代码:
Private Sub Command1_Click()
On Error Resume Next
Adodc4.CommandType = adCmdText
Dim strSearch As String
If Option6.Value = True Then
strSearch = Combo4.Text
Adodc3.RecordSource = "select * from 采购入库单 where 单据号='" & strSearch & "'"
ElseIf Option5.Value = True Then
strSearch = Combo1.Text
Adodc3.RecordSource = "select * from 采购入库单 where 商品编号='" & strSearch & "'"
ElseIf Option6.Value = True Then
strSearch = DTPicker2
Adodc3.RecordSource = "select * from 采购入库单 where 采购日期='" & strSearch & "'"
End If
Set MSHFlexGrid2.DataSource = Adodc4
Adodc4.Refresh
End Sub 展开
注:采购退货单为数据库名称
下面是代码:
Private Sub Command1_Click()
On Error Resume Next
Adodc4.CommandType = adCmdText
Dim strSearch As String
If Option6.Value = True Then
strSearch = Combo4.Text
Adodc3.RecordSource = "select * from 采购入库单 where 单据号='" & strSearch & "'"
ElseIf Option5.Value = True Then
strSearch = Combo1.Text
Adodc3.RecordSource = "select * from 采购入库单 where 商品编号='" & strSearch & "'"
ElseIf Option6.Value = True Then
strSearch = DTPicker2
Adodc3.RecordSource = "select * from 采购入库单 where 采购日期='" & strSearch & "'"
End If
Set MSHFlexGrid2.DataSource = Adodc4
Adodc4.Refresh
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询