try:

<cfquery name="getenv" datasource="profiles" dbtype="ODBC">
         select  alias,destination
         from    profile
         where   alias = '#url.did#'
</cfquery>



>From: "Ricardo Sanoja" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>Subject: RE: <CFQUERY
>Date: Tue, 29 Jan 2002 14:36:34 -0600
>
>My guess was that alias was a reserved word, it isn't, but it should be.
>Be careful when naming field names in databases.  Names like type,
>section, reports, parameters, name, etc are all reserved words, and can
>cause trouble.  I know that I have used some of these words in the past
>as field names myself.  Tune in to my presentation on "Not so Basic SQL"
>at the next CFUG meeting.  I hope to cover a lot of the "gotcha's" of
>SQL.
>
>
>Sincerely,
>Ricardo Sanoja
>Senior Web Architect
>Version 4 Technologies, LLC.
>4288 Kellway Circle
>Addison, TX 75001-4200
>
>214.641.5255
>[EMAIL PROTECTED]
>
>
>-----Original Message-----
>From: phumes1 [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 29, 2002 2:28 PM
>To: [EMAIL PROTECTED]
>Subject: RE: <CFQUERY
>
>
>I added the following into "env_edit_form.cfm"
>
><cfquery name="getenv" datasource="profiles" dbtype="ODBC">
>          select  alias,destination
>          from    profile
>          where   alias = #url.did#
></cfquery>
>
>But I keep getting the same error and I don't know why? If I remove the
>"WHERE" statement then I get no error.
>
><error>
>URL.DID: ACLG
>
>
>Error Occurred While Processing Request
>
>Error Diagnostic InformationODBC Error Code = 07001 (Wrong number of
>parameters) [Microsoft][ODBC Microsoft Access Driver] Too few
>parameters.
>Expected 1. Hint: The cause of this error is usually that your query
>contains a reference to a field which does not exist. You should verify
>that the fields included in your query exist and that you have specified
>
>their names correctly. The error occurred while processing an element
>with
>a general identifier of (CFQUERY), occupying document position (5:1) to
>(5:59).Date/Time: 01/29/02 15:25:57
>Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; msnca3;
>Q312461)
>Remote Address: 192.139.241.145
>HTTP Referrer: http://127.0.0.1/test/admin/profiles/index.cfm
>Query String: DID=ACLG
>
>
>
></error>
>
>
>At 02:12 PM 1/29/2002 -0600, you wrote:
> >last query (getenv) should be...
> >
> ><cfquery name="getenv" datasource="profiles" dbtype="ODBC">
> >         select
> >                 alias,
> >                 destination
> >         from
> >                 profile
> >         where
> >                 alias = #url.did#
> ></cfquery>
> >
> >
> >
> >-----Original Message-----
> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> >Behalf Of phumes1
> >Sent: Tuesday, January 29, 2002 2:12 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: <CFQUERY
> >
> >
> >
> >Hi,
> >
> >I have an access database with the following fields
> >
> >Filename: profiles.mdb
> >Database: profile
> >
> >Fields:
> >
> >alias
> >destination
> >
> >The listing below works great.
> >
> ><CFQUERY NAME="GetEnv" DATASOURCE="Profiles">
> >         SELECT alias, destination
> >         FROM profile
> >         ORDER BY alias
> ></CFQUERY>
> >
> >
> ><table width="572" cellpadding="2" cellspacing="0" border="0">
> ><TR bgcolor="#000000">
> >         <TH class="dirlinks" align="left"><font
> >color="#ffffff"><b>Alias</b></font></TH>
> >         <TH class="dirlinks" align="left"><font
> >color="#ffffff"><b>Destination</b></font></TH>
> >         <TH></TH>
> ></TR>
> >         <CFOUTPUT QUERY="GetEnv">
> ><TR bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('dededf'))#"
> >valign="top">
> >         <TD class="navlinks">#GetEnv.alias#</TD>
> >         <TD class="navlinks">#GetEnv.destination#</TD>
> >         <TD class="navlinks"><A
> >HREF="env_edit_form.cfm?DID=#GetEnv.alias#">[Edit]</A></TD>
> ></TR>
> >         </CFOUTPUT>
> ></TABLE>
> >
> >The problem is my syntax has to be wrong in the file
>"env_edit_form.cfm". I
> >keep getting an error. Here is the code from the file.
> >Syntax is not correct in the "WHERE".
> >
> ><cfoutput>
> >URL.DID: #URL.DID#
> >
> ><cfquery name="GetEnv" datasource="profiles" dbtype="ODBC">
> >         SELECT  alias, destination
> >         FROM    profile
> >         WHERE   (#URL.DID# = #GetEnv.alias#)
> ></cfquery>
> >
> ></cfoutput>
> >
> >
> >
> >
> >
> >-----------------------------------------------------------------------
>--
> >This email server is running an evaluation copy of the MailShield anti-
> >spam software. Please contact your email administrator if you have any
> >questions about this message. MailShield product info:
>www.mailshield.com
> >
> >-----------------------------------------------
> >To post, send email to [EMAIL PROTECTED]
> >To subscribe / unsubscribe: http://www.dfwcfug.org
> >
> >
> >-----------------------------------------------------------------------
>--
> >This email server is running an evaluation copy of the MailShield anti-
> >spam software. Please contact your email administrator if you have any
> >questions about this message. MailShield product info:
>www.mailshield.com
> >
> >-----------------------------------------------
> >To post, send email to [EMAIL PROTECTED]
> >To subscribe / unsubscribe: http://www.dfwcfug.org
>
>
>------------------------------------------------------------------------
>-
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info:
>www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org
>
>-------------------------------------------------------------------------
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info: www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to