错在那里?cn.open "select * from table where dyrq<="dtpicker1.value" and dyrq >= "& dtpicker2.value &"",cn,... 应该这样rs.open "select * from table where dyrq<='" & dtpicker1.value & "' and dyrq >='" & dtpicker2.value &"'",....... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 rs.open "select * from table where dyrq<=" & dtpicker1.value & " and dyrq >= " & dtpicker2.value & "",cn,... 你用什么数据库?不同的数据库语法不一样DYRQ是什么类型?不同的类型处理不一样 如果你的SQL语句有变量,请把SQL语句放在一个 字符串变量中.比如: dim sc as string sc ="select * from table where Field_A ='" & text1.text & "'" rs.open sc,cn 我用的是Access数据库,dyrq是日期/时间类型.若用SQL会如何写呢? 如用Access数据库应该这样rs.open "select * from table where dyrq<=#" & dtpicker1.value & "# and dyrq >=#" & dtpicker2.value &"#",....... 用charise(VB恐怖分子)的方法是最好加上format的调用,如format(dtpicker1.value,"yyyy/MM/dd") 星期数字显示改成汉字显示 请大家给出个点子(想做vb作品) 循环 请教VB连接ORACLE的ADO代码 这句不能用啊,If resUser.State = adStateOpen Then resUser.Close 怎样在win2000server下添加一个用户组? 怎样判断msflexgrid某几行被shift选中了 问一下有没有知道,哪个网站有VB的函数大全 我烦死了,谁帮我我送100!一定给!!是关于字段拆分的 不知是什么问题?请教列位 请各位出些自己认为不错的VB题目,交流一下吧 ★★不知Vb中读写注册表的API函数在WinXP中是否能正常操作?望各位大虾给个意见!
不同的数据库语法不一样
DYRQ是什么类型?
不同的类型处理不一样
比如:
dim sc as string
sc ="select * from table where Field_A ='" & text1.text & "'"
rs.open sc,cn
rs.open "select * from table where dyrq<=#" & dtpicker1.value & "# and dyrq >=#" & dtpicker2.value &"#",.......
如format(dtpicker1.value,"yyyy/MM/dd")