比方说,就是希望将下面转换为能在窗体命令按纽使用的:
SELECT tb藏书情况.书籍编号, tb藏书情况.书名, tb规则.类别, tb藏书情况.作者, tb出版社名单.出版社, tb藏书情况.单价, tb藏书情况.进书日期
FROM (tb藏书情况 INNER JOIN tb出版社名单 ON tb藏书情况.出版社ID = tb出版社名单.出版社ID) INNER JOIN tb规则 ON tb藏书情况.类别ID = tb规则.类别ID
WHERE (((tb藏书情况.书名) Like IIf(IsNull([Forms]![存书查询窗体]![书名]),'*','*' & [Forms]![存书查询窗体]![书名] & '*')) AND ((tb规则.类别) Like IIf(IsNull([Forms]![存书查询窗体]![类别]),'*',[Forms]![存书查询窗体]![类别])) AND ((tb藏书情况.作者) Like IIf(IsNull([Forms]![存书查询窗体]![作者]),'*','*' & [Forms]![存书查询窗体]![作者] & '*')) AND ((tb出版社名单.出版社) Like IIf(IsNull([Forms]![存书查询窗体]![出版社]),'*',[Forms]![存书查询窗体]![出版社])) AND ((tb藏书情况.单价) Between IIf(IsNull([Forms]![存书查询窗体]![单价开始]),0,[Forms]![存书查询窗体]![单价开始]) And IIf(IsNull([Forms]![存书查询窗体]![单价截止]),5000,[Forms]![存书查询窗体]![单价截止])) AND ((tb藏书情况.进书日期) Between (IIf(IsNull([Forms]![存书查询窗体]![进书日期开始]),#1/1/2000#,[Forms]![存书查询窗体]![进书日期开始])) And (IIf(IsNull([Forms]![存书查询窗体]![进书日期截止]),#12/31/2099#,[Forms]![存书查询窗体]![进书日期截止]))));
窗体下代码大概是:
DIM sql as string,
.....
sql="select * from tablie1"
.....
.....
现在就想把上面的代码转化成能替换select * from tablie1部分的代码,