风尘之子 - 2006-1-4 15:36:00
command1的代码
Dim txt2 As String
Dim txt1 As String
On Error GoTo err01
txt1 = CDate(DTPicker1.Value)
txt2 = "select 日期,物品名称,金额,单位,数量,购买地 from many where 日期=" & txt1 & ""
Adodc1.RecordSource = txt2
Adodc1.Refresh
err01:
If Err.Number = 3726 Then
MsgBox "输入不存在的,或者找不到该记录!"
End If
通过以上查询,数据无显示呀!
风尘之子 - 2006-1-5 13:01:00
【回复“朱晓磊”的帖子】你说用那些好,能给出一些实例来嘛?
大家共讨一下!
IvanChiu - 2006-1-18 11:32:00
Dim txt2 As String
On Error GoTo err01
txt2 = "select 日期,物品名称,金额,单位,数量,购买地 from many where 日期=" & DTPicker1.Value1 & ""
Adodc1.RecordSource = txt2
Adodc1.Refresh
err01:
If Err.Number = 3726 Then
MsgBox "输入不存在的,或者找不到该记录!"
End If
同时,请参考VB方面的书,你的ADO语法不正确,你没有定义txt2要输出哪个字段的内容。
© 2000 - 2026 Rising Corp. Ltd.