请高手帮我看看setfilter的参数那里错了?

我写了一段setfilter语句,结果提示expression is not valid
如下:
sqlfilter = "yearnow = " + " year_f " + "and monthnow = " + " month_f " + "and xunnow = " + " xun_f " + "and class = " + " class_f " + "and factory = " + " factor_f "
dw_1.setfilter=(sqlfilter)
dw_1.retrieve()
其中yearnow,monthnow,xunnow,class,factory为字段
year_f,month_f,xun_f,class_f,factory_f为string变量
[385 byte] By [superboy_11-超人] at [2008-5-20]
# 1
呵呵!你的语句错了!
1.变量不要加引号!
2.引号要放在引号里(双引号扩单引号)

sqlfilter = "yearnow = ‘" + year_f + "’and monthnow = ‘" + month_f + "’"
3.字符性质的参数要加引号,数值性质的不要加引号!
ideage-莲花宝典 at 2007-10-24 > top of Msdn China Tech,PowerBuilder,基础类...
# 2
dw_1.retrieve()
sqlfilter = "yearnow = '" + year_f + "' and monthnow = '" + month_f + "' and xunnow = '" + xun_f + "' and class = '" + class_f + "' and factory = '" + factor_f +"'"
dw_1.setfilter(sqlfilter)
dw_1.filter()
yacc80-我的文档 at 2007-10-24 > top of Msdn China Tech,PowerBuilder,基础类...
# 3
修改:
sqlfilter = 'yearnow = ~'' + year_f + '~' and monthnow = ~'' + month_f + '~' and xunnow = ~'' + xun_f + '~' and class = ~'' + class_f + '~' and factory = ~'' + factor_f + '~''
lesni-乐S你 at 2007-10-24 > top of Msdn China Tech,PowerBuilder,基础类...