0
Explorer
,
/t5/coldfusion-discussions/error-with-cfstoredproc-and-msaccess/td-p/587474
Apr 11, 2007
Apr 11, 2007
Copy link to clipboard
Copied
I am having a problem with running a storedproc from access.
I am using a storedproc because I am selecting based upon date (a
cfvariable) and access required dates to be surrounded by #'s. (Is
there another way to do this?) --
thanks for any help in advance -
here is what i have in my source..
<cfstoredproc datasource="#DSN#" procedure="qryGetDailyEvents">
<cfprocresult name="qryGetDailyEvents">
<!--- <cfprocparam cfsqltype="cf_sql_date" value="#DateFormat(currentDate, "m/d/yyyy")#" dbvarname="@today">
worked in development but not in production
--->
<cfprocparam cfsqltype="cf_sql_date" value="#DateFormat(currentDate, "m/d/yyyy")#">
</cfstoredproc>
here is the query i am using in access..
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team=t.id And e.eventdate=[@today];
and finally
here is the error i am getting
----------------------
Error Occurred While Processing Request
Error Executing Database Query.
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
The error occurred in D:\Hosting\shencrew\NewWebPage\calendar\cal.cfm: line 80
Called from D:\Hosting\shencrew\NewWebPage\calendar.cfm: line 73
Called from D:\Hosting\shencrew\NewWebPage\calendar\cal.cfm: line 80
Called from D:\Hosting\shencrew\NewWebPage\calendar.cfm: line 73
78 : <cfprocparam
79 : cfsqltype="cf_sql_date"
80 : value="#DateFormat(currentDate, "m/d/yyyy")#">
81 : </cfstoredproc>
82 :
--------------------------------------------------------------------------------
SQL {call qryGetDailyEvents( (param 1) )}
DATASOURCE shencrew_accesscf_crew
VENDORERRORCODE 3092
SQLSTATE
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)
Remote Address 72.224.77.202
Referrer
Date/Time 11-Apr-07 08:22 AM
Stack Trace (click to expand)
----------------------
thanks for any help in advance -
here is what i have in my source..
<cfstoredproc datasource="#DSN#" procedure="qryGetDailyEvents">
<cfprocresult name="qryGetDailyEvents">
<!--- <cfprocparam cfsqltype="cf_sql_date" value="#DateFormat(currentDate, "m/d/yyyy")#" dbvarname="@today">
worked in development but not in production
--->
<cfprocparam cfsqltype="cf_sql_date" value="#DateFormat(currentDate, "m/d/yyyy")#">
</cfstoredproc>
here is the query i am using in access..
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team=t.id And e.eventdate=[@today];
and finally
here is the error i am getting
----------------------
Error Occurred While Processing Request
Error Executing Database Query.
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
The error occurred in D:\Hosting\shencrew\NewWebPage\calendar\cal.cfm: line 80
Called from D:\Hosting\shencrew\NewWebPage\calendar.cfm: line 73
Called from D:\Hosting\shencrew\NewWebPage\calendar\cal.cfm: line 80
Called from D:\Hosting\shencrew\NewWebPage\calendar.cfm: line 73
78 : <cfprocparam
79 : cfsqltype="cf_sql_date"
80 : value="#DateFormat(currentDate, "m/d/yyyy")#">
81 : </cfstoredproc>
82 :
--------------------------------------------------------------------------------
SQL {call qryGetDailyEvents( (param 1) )}
DATASOURCE shencrew_accesscf_crew
VENDORERRORCODE 3092
SQLSTATE
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)
Remote Address 72.224.77.202
Referrer
Date/Time 11-Apr-07 08:22 AM
Stack Trace (click to expand)
----------------------
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Mentor
,
Apr 11, 2007
Apr 11, 2007
How about just using a cfquery, something like this?
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team=t.id
And e.eventdate=#CreateODBCDateTime(Now())#
As for the stored procedure, are you declaring the date paramer as a PARAMETERS statement in your access query, such as in the following?
PARAMETERS in_today Date/Time;
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tbl...
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team=t.id
And e.eventdate=#CreateODBCDateTime(Now())#
As for the stored procedure, are you declaring the date paramer as a PARAMETERS statement in your access query, such as in the following?
PARAMETERS in_today Date/Time;
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tbl...
Mentor
,
/t5/coldfusion-discussions/error-with-cfstoredproc-and-msaccess/m-p/587475#M54254
Apr 11, 2007
Apr 11, 2007
Copy link to clipboard
Copied
How about just using a cfquery, something like this?
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team=t.id
And e.eventdate=#CreateODBCDateTime(Now())#
As for the stored procedure, are you declaring the date paramer as a PARAMETERS statement in your access query, such as in the following?
PARAMETERS in_today Date/Time;
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team = t.id
AND e.eventdate = in_today;
Phil
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team=t.id
And e.eventdate=#CreateODBCDateTime(Now())#
As for the stored procedure, are you declaring the date paramer as a PARAMETERS statement in your access query, such as in the following?
PARAMETERS in_today Date/Time;
SELECT e.id, e.team AS teamid, t.team, e.eventtime, e.title, e.link, e.notes
FROM tblEvents AS e, tblTeam AS t
WHERE e.team = t.id
AND e.eventdate = in_today;
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
/t5/coldfusion-discussions/error-with-cfstoredproc-and-msaccess/m-p/587476#M54255
Apr 11, 2007
Apr 11, 2007
Copy link to clipboard
Copied
Access does not support Stored Procedures. SP are supported
by SQL engines like MS SQL,MySQL5, Oracle, etc....
Regards
Regards
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
stephenmbell
AUTHOR
Explorer
,
/t5/coldfusion-discussions/error-with-cfstoredproc-and-msaccess/m-p/587477#M54256
Apr 11, 2007
Apr 11, 2007
Copy link to clipboard
Copied
I know that MSACCESS does not support stored procedures
however in CFMX (atleast 6.1, i know of) you can run an MSACCESS
query as a cfstoredproc.
I ended up using a cfquery with CreateODBCDateTime() and it worked fine.
Thank you for the input.
I ended up using a cfquery with CreateODBCDateTime() and it worked fine.
Thank you for the input.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
LATEST
/t5/coldfusion-discussions/error-with-cfstoredproc-and-msaccess/m-p/587478#M54257
Apr 11, 2007
Apr 11, 2007
Copy link to clipboard
Copied
Yes, that is correct, you can run a query stored in Access as
a stored procedure, and even pass parameters provided you declare
the PARAMETERS in the query.
Phil
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

