当前位置:编程学习 > VB >>

请帮忙改错

写了一段程序想调用数据库中的一个记录,数据库中有三个字段:用户名 日期 备忘录(文本)。现在想查询用户名和日期,找到记录后,把备忘录中的内容显示在RichTextBox1中,可是运行时出错了,有提示标记处数据类型不匹配,应如何改,其他地方还有错吗?
Private Sub Form_Load()
Dim rs_add As New ADODB.Recordset
gConnDB
rs_add.Open "select*from bwl where 用户名='" & zjm.Text1 & "' and 日期='" & Label1.Caption & "' ", gCnn,1,3 
If rs_add.RecordCount > 0 Then
RichTextBox1.Text = s_add.feilds(3)
rs_add.Update
rs_add.Close
End If
End Sub --------------------编程问答-------------------- 结帖率:0.00%  --------------------编程问答-------------------- rs_add.Open "select * from bwl where 用户名='" & zjm.Text1 & "' and 日期='" & Label1.Caption & "' ", gCnn,1,3 
--------------------编程问答--------------------
rs_add.Open "select * from bwl where 用户名='" & zjm.Text1 & "' and 日期=#" & CDate(Label1.Caption) & "#", gCnn,1,3 
补充:VB ,  数据库(包含打印,安装,报表)
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,