True but you still need to cerate a function called cfquery, here is
the code from the article:
<cffunction name="CFQUERY" access="public" returntype="query">
<cfargument name="SQLString" type="string" required="yes">
<cfargument name="Datasource" type="string" required="yes">
<cfargument name="dbType" type="string" default="">
<cfquery name="RecordSet" datasource="#arguments.Datasource#"
dbtype="#arguments.dbType#">
#preserveSingleQuotes(arguments.SQLString)#
</cfquery>
<cfreturn RecordSet>
</cffunction>
You'll need to have that somewhere in your template or application.cfm
Cheers
G
On Wed, 18 Aug 2004 10:43:01 -0400, Howie Hamlin <[EMAIL PROTECTED]> wrote:
> No, I'm basing my code from this article:
>
> http://www.macromedia.com/devnet/mx/coldfusion/extreme/cftags_cfscript.html
>
> The sample code in the article seems to call a CFQuery from within a CFSCRIPT block:
>
> <CFSCRIPT>
> SQLString = "Select * From LoginInfo where
> UserID='BobZ' and Password = 'Ads10'";
> DATASOURCE = "CompanyInfo";
> checkUser=CFQUERY(SQLString: SQLString,
> DATASOURCE: DATASOURCE);
> if (checkUser.recordCount neq 0) {
> CFOUTPUT("Welcome Back, " & checkUser.UserID);
> } else {
> CFOUTPUT("Your UserName is Wrong.. try again!");
> CFLOCATION(theURL:"login.cfm");
> }
> </CFSCRIPT>Thanks,Howie----- Original Message -----
> From: Adrian Lynch
> To: CF-Talk
> Sent: Wednesday, August 18, 2004 10:41 AM
> Subject: RE: Query from within a cfscript
>
> Have you got a function of your own called CFQuery()?
>
> Ade
>
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Query from within a cfscript Howie Hamlin
- Re: Query from within a cfscript Greg Stewart
- Re: Query from within a cfscript Howie Hamlin
- RE: Query from within a cfscript Tangorre, Michael
- Re: Query from within a cfscript Howie Hamlin
- RE: Query from within a cfscript Adrian Lynch
- Re: Query from within a cfscript Howie Hamlin
- RE: Query from within a cfscript Adrian Lynch
- Re: Query from within a cfscri... Howie Hamlin
- Re: Query from within a cfscript Greg Stewart
- Re: Query from within a cfscri... Howie Hamlin