Hi,

Me again...

I have a database with the following fields:

Database File: profiles.mdb
Database Name: profile
Fields: profile_ID, env_var, destination

I have three files and below them is the code. Everything works great until 
I try and make a change and "update" the database I get the following 
error. Its probably so simple but I don't see it.

<error>
Error Occurred While Processing Request
Error Diagnostic InformationODBC Error Code = 22005 (Error in assignment) 
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria 
expression. The error occurred while processing an element with a general 
identifier of (CFQUERY), occupying document position (13:1) to 
(13:53).Date/Time: 01/30/02 10:08:51
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/env_edit_form.cfm?DID=ACLG

</error>

index.cfm
env_edit_form.cfm
env_edit_action.cfm


INDEX.CFM
----------------
<CFQUERY NAME="GetEnv" DATASOURCE="Profiles">
         SELECT profile_ID, env_var, destination
         FROM profile
         ORDER BY env_var
</CFQUERY>

<P>
<P>

<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.env_var#</TD>
         <TD class="navlinks">#GetEnv.destination#</TD>
         <TD class="navlinks"><A 
HREF="env_edit_form.cfm?DID=#GetEnv.env_var#">[Edit]</A></TD>
</TR>
         </CFOUTPUT>
</TABLE>
<P>
<P>

<A HREF="env_Add_Form.cfm"><font class="navlinks">[Add]</font></A>

<P>
<P>




ENV_EDIT_FORM.CFM
--------------------------------


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

<CFFORM ACTION="env_edit_action.cfm" method="post">
         <input type="hidden" name="env_var_Required" value="Please specify 
Alias Name.">

         <TABLE>
         <CFOUTPUT>
         <!---Create a hidden field to pass the PK of Distributor --->
         <input type="hidden" name="profile_ID" value="#getenv.profile_ID#">
         <TR>
                 <TD class="navlinks">Profile_ID</TD>
                 <TD class="navlinks"><input type="text"
                                 name="profile_ID"
                                 class="navlinks"
                                 value="#GetEnv.profile_ID#"
                                 maxlength="30"></TD>
         </TR>
         <TR>
                 <TD class="navlinks">Alias Name</TD>
                 <TD class="navlinks"><cfinput type="Text"
                                 name="env_var"
                                 class="navlinks"
                                 value="#GetEnv.env_var#"
                                 message="Please input a Alias Name!"
                                 required="Yes"
                                 size="30"
                                 maxlength="50"></TD>
         </TR>
         <TR>
                 <TD class="navlinks">Destination</TD>
                 <TD class="navlinks"><input type="text"
                                 class="navlinks"
                                 name="destination"
                                 value="#GetEnv.destination#"
                                 maxlength="30"></TD>
         </TR>
         </CFOUTPUT>
         <TR>
                 <TD class="navlinks"><input class="navlinks" type="submit" 
name="Action" value="Update"></TD>
                 <TD></TD>
         </TR>
         </TABLE>
</CFFORM>



ENV_EDIT_ACTION.CFM
--------------------------------

<cfoutput>
profile_ID: #profile_ID#<br>
env_var: #env_var#<br>
destination: #destination#<br>
<br>
FORM.profile_ID: #FORM.profile_ID#<br>
FORM.env_var: #FORM.env_var#<br>
FORM.destination: #FORM.destination#<br>

<cfquery name="update_profile" datasource="profiles">
                 UPDATE profile
                 SET
                 env_var = '#FORM.env_var#',
                 destination = '#FORM.destination#'
                 where
                 profile_ID = '#FORM.profile_ID#'
</cfquery>

</cfoutput>

<cflocation url="index.cfm">



-------------------------------------------------------------------------
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