我需要使用 Access 2007 和 ColdFusion 8 在一个简单的选择语句中组合 2 列的值。当我在 Access 中运行查询时,我得到了没有问题的结果,但是当我将下面的查询放在 ColdFusion 中时,它不会运行:
<cfquery name="Maj" datasource="#application.dsn#">
SELECT Majors & " " & GradeLevel
FROM Programs
WHERE Categories = 'Language'
ORDER BY Majors
</cfquery>
它产生以下错误:
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
The error occurred in C:\Inetpub\wwwroot\test.cfm: line 4
2 :
3 :
4 : <cfquery name="Maj" datasource="#application.dsn#">
5 : SELECT Majors & " " & GradeLevel
6 : FROM Programs