为什么在调试的时候 Adodc1.Refresh出错呢? 对象‘Refresh’的方法‘IAdodc’失败 5
PrivateSubCommand1_Click()Adodc1.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;D...
Private Sub Command1_Click()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\铁路运输货运服务系统\车种.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from P"
If DataCombo1.Text <> "" And DataCombo2.Text = "" And DataCombo3 = "" Then
Adodc1.RecordSource = " select * from P where 载重(t)='" & DataCombo1.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text = "" And DataCombo2.Text <> "" And DataCombo3 = "" Then
Adodc1.RecordSource = " select * from P where 商业运行速度km/h='" & DataCombo2.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text = "" And DataCombo2.Text = "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 总容积m3='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text <> "" And DataCombo2.Text <> "" And DataCombo3 = "" Then
Adodc1.RecordSource = " select * from P where 载重(t)='" & DataCombo1.Text & "'and 商业运行速度km/h='" & DataCombo2.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text <> "" And DataCombo2.Text = "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 载重(t)='" & DataCombo1.Text & "'and 总容积m3 ='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text = "" And DataCombo2.Text <> "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 商业运行速度km/h='" & DataCombo2.Text & "'and 总容积m3='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text <> "" And DataCombo2.Text <> "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 载重(t)= '" & DataCombo1.Text & "'and 商业运行速度km/h='" & DataCombo2.Text & "' and 总容积m3='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
End If
End Sub
Form子句语法错误
实时错误'-2147217900(80040e14)'
谢谢帮忙了
数据库连接上了,Adodc1也设置好了
请各位大神都看看,把改好的程序给我发一下!以前有人成功用过这程序,我重建的表和字段。急盼!!!谢谢 展开
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\铁路运输货运服务系统\车种.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from P"
If DataCombo1.Text <> "" And DataCombo2.Text = "" And DataCombo3 = "" Then
Adodc1.RecordSource = " select * from P where 载重(t)='" & DataCombo1.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text = "" And DataCombo2.Text <> "" And DataCombo3 = "" Then
Adodc1.RecordSource = " select * from P where 商业运行速度km/h='" & DataCombo2.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text = "" And DataCombo2.Text = "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 总容积m3='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text <> "" And DataCombo2.Text <> "" And DataCombo3 = "" Then
Adodc1.RecordSource = " select * from P where 载重(t)='" & DataCombo1.Text & "'and 商业运行速度km/h='" & DataCombo2.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text <> "" And DataCombo2.Text = "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 载重(t)='" & DataCombo1.Text & "'and 总容积m3 ='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text = "" And DataCombo2.Text <> "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 商业运行速度km/h='" & DataCombo2.Text & "'and 总容积m3='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
End If
If DataCombo1.Text <> "" And DataCombo2.Text <> "" And DataCombo3 <> "" Then
Adodc1.RecordSource = " select * from P where 载重(t)= '" & DataCombo1.Text & "'and 商业运行速度km/h='" & DataCombo2.Text & "' and 总容积m3='" & DataCombo3.Text & "'"
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
End If
End Sub
Form子句语法错误
实时错误'-2147217900(80040e14)'
谢谢帮忙了
数据库连接上了,Adodc1也设置好了
请各位大神都看看,把改好的程序给我发一下!以前有人成功用过这程序,我重建的表和字段。急盼!!!谢谢 展开
2个回答
展开全部
adodc属性----记录源----改成 1 - adcmdtext----在下面输入字符串 “select * from ***”
就好了 祝你成功
就好了 祝你成功
追问
多谢 你说得特对 但是又出现了:“有一个变量未被定义”这样的错误。请问高人咋样解决??
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询