1.在数据环境中的SQL语句输入 select Name,JB,Tdate from newwork where Tdate=? 2.确定后制定参数的数据类型为日期型 3.代码中使用 if DEV.rsCommand.State=1 then DEV.rsCommand.Close DEV.Command Cdate(MyDate) 这样就打开你要的记录集了
还是不行。 我是这样写的: SELECT name,jb,tdate FROM Dowork WHERE (takemoney = True) AND (takedate >= '"& ydate & "')是不是有错。用Adodc控件都没有问题,在数据环境中就不行。 ydate 是在模块中定义的全局变量。
"SELECT name,jb,tdate FROM Dowork WHERE (takemoney = True) AND (takedate >= " & ydate & ")"
CMD.CommandType = adCmdText
CMD.CommandText = "select Name,JB,Tdate from newwork where Tdate=?"CMD.Parameters.Append CMD.CreateParameter(, adVarChar, _ adParamInput, 100, RecordInfo(1))
set rs =CMD.Execute
select Name,JB,Tdate from newwork where Tdate=?
2.确定后制定参数的数据类型为日期型
3.代码中使用
if DEV.rsCommand.State=1 then DEV.rsCommand.Close
DEV.Command Cdate(MyDate)
这样就打开你要的记录集了
我是这样写的:
SELECT name,jb,tdate FROM Dowork WHERE (takemoney = True) AND (takedate >= '"& ydate & "')是不是有错。用Adodc控件都没有问题,在数据环境中就不行。
ydate 是在模块中定义的全局变量。