Ask a Question related to Coldfusion Database Access, Design and Development.
-
albatross07 #1
Join Query works in access but not via ColdFusion
I have a query I built with the query builder in Access and through access it
works fine.
here is the query:
SELECT
appUsers.AppId,
LAWSON_SHC_EMPLOYEE_V.FIRST_NAME,
LAWSON_SHC_EMPLOYEE_V.EMPLOYEE,
LAWSON_SHC_EMPLOYEE_V.LAST_NAME
FROM
appUsers
INNER JOIN
LAWSON_SHC_EMPLOYEE_V
ON appUsers.EmpId = LAWSON_SHC_EMPLOYEE_V.EMPLOYEE
WHERE (((appUsers.AppId)=111) AND ((LAWSON_SHC_EMPLOYEE_V.EMPLOYEE)=18796)
AND ((LAWSON_SHC_EMPLOYEE_V.LAST_NAME)="SMITH"));
again this works fine in access so then I make slight modifications to imbed
it into my ColdFusion template
SELECT
LAWSON_SHC_EMPLOYEE_V.FIRST_NAME,
LAWSON_SHC_EMPLOYEE_V.EMPLOYEE,
LAWSON_SHC_EMPLOYEE_V.LAST_NAME,
appUsers.AppId
FROM
appUsers
INNER JOIN
LAWSON_SHC_EMPLOYEE_V
ON
appUsers.EmpId = LAWSON_SHC_EMPLOYEE_V.EMPLOYEE
WHERE
LAWSON_SHC_EMPLOYEE_V.EMPLOYEE = <cfqueryparam value="#form.empID#"
cfsqltype="cf_sql_integer"> AND
LAWSON_SHC_EMPLOYEE_V.LAST_NAME= <cfqueryparam value="#ucase(form.Lname)#"
cfsqltype="cf_sql_char"> AND
appUsers.AppId = <cfqueryparam value="111" cfsqltype="cf_sql_integer">
This one doesnt work. before I added the CfqueryParams I got a 2 few
parameters expected 2. After adding the CfqueryParams the errors stopped but I
get an empty recordset when I should get 1 row back. To make matters even more
interesting when I change the INNER JOIN to a LEFT JOIN it seems to work. What
bothers me the most is that I cannot explain why it will work as left join but
not inner, and my boos wont le tthe app go live untill I can.
any insight will be appreciated.
Thanks Ron
albatross07 Guest
-
Lotus Notes Query with ColdFusion - Access
Is it possible to access/query Lotus Notes with Coldfusion? How can I create the DSN in Coldfusion Administrator Successfully? I have searched... -
MS Access Union Join not working w/ Coldfusion MX
Hope this makes sense. I'm new to this and trying to figure it out. I'm having problems getting a union join to work w/ Coldfusion MX 6.1. I have... -
Query Works in ACCESS DB but not on Front End
Okay...i am trying to run a query to view people that are overdue in there medical appts. i did the <cfoutput> in place of <cfquery> and ran the... -
Working through an update query Coldfusion/Access
I'm working on an update query for a class registration system in ColdFusion 6.1 running against an Access 2000 datasource. In short what I need to... -
BCP query out executed by xp_cmdshell works fine from query analyzer but fails from VB Component
Hi all, I have a stored procedure which returns a vast number of record and i have to write the output into a csv file. I'm using BCP utility to... -
javabuzz #2
Re: Join Query works in access but not via ColdFusion
albatross07 wrote:
access it> I have a query I built with the query builder in Access and through((LAWSON_SHC_EMPLOYEE_V.EMPLOYEE)=18796)> works fine.
> here is the query:
> SELECT
> appUsers.AppId,
> LAWSON_SHC_EMPLOYEE_V.FIRST_NAME,
> LAWSON_SHC_EMPLOYEE_V.EMPLOYEE,
> LAWSON_SHC_EMPLOYEE_V.LAST_NAME
> FROM
> appUsers
> INNER JOIN
> LAWSON_SHC_EMPLOYEE_V
> ON appUsers.EmpId = LAWSON_SHC_EMPLOYEE_V.EMPLOYEE
> WHERE (((appUsers.AppId)=111) ANDto imbed> AND ((LAWSON_SHC_EMPLOYEE_V.LAST_NAME)="SMITH"));
>
> again this works fine in access so then I make slight modifications> it into my ColdFusion template
>
> SELECT
> LAWSON_SHC_EMPLOYEE_V.FIRST_NAME,
> LAWSON_SHC_EMPLOYEE_V.EMPLOYEE,
> LAWSON_SHC_EMPLOYEE_V.LAST_NAME,
> appUsers.AppId
> FROM
> appUsers
> INNER JOIN
> LAWSON_SHC_EMPLOYEE_V
> ON
> appUsers.EmpId = LAWSON_SHC_EMPLOYEE_V.EMPLOYEE
> WHERE
> LAWSON_SHC_EMPLOYEE_V.EMPLOYEE = <cfqueryparam value="#form.empID#"value="#ucase(form.Lname)#"> cfsqltype="cf_sql_integer"> AND
> LAWSON_SHC_EMPLOYEE_V.LAST_NAME= <cfqueryparamcfsqltype="cf_sql_integer">> cfsqltype="cf_sql_char"> AND
> appUsers.AppId = <cfqueryparam value="111"few>
> This one doesnt work. before I added the CfqueryParams I got a 2stopped but I> parameters expected 2. After adding the CfqueryParams the errorseven more> get an empty recordset when I should get 1 row back. To make matterswork. What> interesting when I change the INNER JOIN to a LEFT JOIN it seems tojoin but> bothers me the most is that I cannot explain why it will work as leftJust a thought - When passing text in a SQL statement to an ODBC or> not inner, and my boos wont le tthe app go live untill I can.
>
> any insight will be appreciated.
>
> Thanks Ron
JDBC driver, you must use single quotation marks. If you use double
quotation marks, the parser treats the first double quotation mark as a
statement terminator, ignoring all the text after it.
javabuzz Guest
-
vkunirs #3
Re: Join Query works in access but not via ColdFusion
Hi
you are saying the same query is working fine in the ms-access, then for
testing just execute the same query from the cfquery with the same values.
then check out is there any problem, if it works fine then replaces the values
with cf varaibles.
or else
just display the query before executing it in cf. copy that query executed
it in the ms-access thensee how many records it is returning.
:cool;
vkunirs Guest



Reply With Quote

