在cfquery中与access db连接的语法是什么?

时间:2011-03-15 20:46:34

标签: sql ms-access coldfusion cfquery

所以,我在网上看到了这个简单的答案......我找不到它。

我正在尝试通过coldfusion查询来搜索访问数据库。

<cfquery name = "x" datasource = "cassupport_computers">
SELECT last, first, dept, location, purchasedate, (last + ' ' + first + ' ' + dept + ' ' + location + ' ' + purchasedate AS searchs)
FROM cas_computers
WHERE searchs like '%#form.searchfield#%'
</cfquery>

我做错了什么? X:

1 个答案:

答案 0 :(得分:3)

<cfquery name = "x" datasource = "cassupport_computers">
SELECT last, first, dept, location, purchasedate, last & ' ' & first & ' ' & dept & ' ' & location & ' ' & purchasedate AS searchs
FROM cas_computers
WHERE searchs like '%#form.searchfield#%'
</cfquery>