我有程序中使用了ADODC控件,具体语句是Adodc1.Refresh但报
[驱动程序管理器]未发现数据源名称并未指定默认驱动程序
我用的是Access数据库,是我数据源配的有问题吗?
卸了从装
Private Sub Command1_Click()
On Error Resume Next
If Trim(Text1.Text) = "" Then
MsgBox "编号不能为空", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
End If
If Trim(Combo1.Text) = "" Then
MsgBox "请选择发货地", vbOKOnly + vbExclamation, "提示"
Combo1.SetFocus
End If
If Trim(Text3.Text) = "" Then
MsgBox "货单不能为空", vbOKOnly + vbExclamation, "提示"
Text3.SetFocus
End If
If Command1.Caption = "添加" Then
Command1.Caption = "确认"
Command2.Enabled = False
Adodc1.Recordset.AddNew
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Text1.SetFocus
Else
Command1.Caption = "添加"
Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Command3.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Data1.RecordSource = "select * from InOutinfo"
Data1.Refresh
Adodc1.Refresh
End Sub
Private Sub Form_Activate()
Data1.RecordSource = "select * from InOutinfo"
Data1.Refresh
Adodc1.Refresh /此行报我上面写的错误/
End Sub