Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-18-2006, 10:22 PM   PM User | #1
jargon12
New to the CF scene

 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jargon12 is an unknown quantity at this point
Question CF / MS Access : Number of query values and destination fields are not the same.

hi newbie here with a Microsoft Access & Cold Fusion problem.

Im seem to be having some problems with a simple form that sends data post method to fusebox.cfm
The fusebox.cfm is supposed to take the variables and put it in my Microsoft Access DB. Unfortunately, I get an error that says:

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.

Here is my form:

Code:
<form name="distributionProfile" action="fusebox.cfm" method="post">
<input type="hidden" name="process" value="profile" />


<cfoutput query="pullUserID">
<input type="hidden" name="dist_user_id" value="#user_id#" />
</cfoutput>


<table width="600" cellspacing="4">
  <tr class="table_color">
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Orphanage Name</strong></div></td>
    <td><input name="orphanage_name" type="text" id="orphanage_name" size="40" maxlength="255"></td>
  </tr>
  <tr>
    <td bgcolor="#E2E2E2"><div align="right"><strong>Date of Distribution </strong></div></td>
    <td class="table_color"><input name="distributionDate" type="text" id="orphanage_name2" size="40" maxlength="255" />	</td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Orphanage ID</strong></div></td>
    <td><input name="orphanage_ID" type="text" id="orphanage_ID" size="10" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Geographic Location</strong></div></td>
    <td><input name="geographic_location" type="text" id="geographic_location" size="40" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Kilometers from Chisinau</strong></div></td>
    <td><input name="kilometer_chisinau" type="text" id="kilometer_chisinau" size="10" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Weather Conditions</strong></div></td>
    <td><input name="weather_conditions" type="text" id="weather_conditions" size="40" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Number of Children</strong></div></td>
    <td><input name="num_of_children" type="text" id="num_of_children" size="10" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Number of Families who received Foodbags</strong></div></td>
    <td><input name="num_of_fam_foodbags" type="text" id="num_of_fam_foodbags" size="10" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" valign="top" bgcolor="#E2E2E2"><div align="right"><strong>Summary</strong></div></td>
    <td>
      <textarea name="summary" cols="35" rows="4" id="summary"></textarea>       </td>
  </tr>
  <tr>
    <td width="250" valign="top" bgcolor="#E2E2E2"><div align="right"><strong>Other Comments</strong></div></td>
    <td><textarea name="other_comments" cols="35" rows="4" id="other_comments"></textarea></td>
  </tr>
  <tr>
    <td width="250" bgcolor="#E2E2E2"><div align="right"><strong>Lsm Personnel name</strong></div></td>
    <td><input name="lsm_personnel" type="text" id="lsm_personnel" size="40" maxlength="255"></td>
  </tr>
  <tr>
    <td width="250" align="right" valign="top" bgcolor="#E2E2E2"><div align="right"><strong>Quotes  </strong></div></td>
    <td><table width="100%">
      <tr>
        <td width="25%">From:</td>
        <td>
          <input name="quote_from" type="text" id="quote_from" size="40" />             </td>
      </tr>
      <tr>
        <td width="25%">Item:</td>
        <td><input name="quote_item" type="text" id="quote_item" size="40" /></td>
      </tr>
      <tr>
        <td width="25%">Remark:</td>
        <td><textarea name="quote_remark" cols="35" rows="4" id="quote_remark"></textarea></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="250"><div align="right"></div></td>
    <td>
      <label>
      <input type="reset" name="Reset" value="Reset">
      <input type="submit" name="Submit2" value="Submit">
      </label>       </td>
  </tr>
</table>
</form>

Here is my fusebox.cfm code:

Quote:
<cfcase value="profile">

<cfquery datasource="distribution" name="addInfo">

INSERT INTO distribution_profile ( orphanage_name,
distribution_date,
orphanage_id,
geographic_location,
k_from_chisinau,
weather_condidtions,
num_of_children,
num_of_fam_rec_foodbags,
[summary],
other_comments,
lsm_personel_name,
dist_user_id)

VALUES ( '#FORM.orphanage_name#',
'#FORM.distributionDate#',
'#FORM.orphanage_ID#',
'#FORM.geographic_location#',
'#FORM.kilometer_chisinau#',
'#FORM.weather_conditions#',
'#FORM.num_of_children#',
'#FORM.num_of_fam_foodbags#',
'#FORM.summary#',
'#FORM.other_comments#',
'#FORM.other_comments#',
'#FORM.lsm_personnel#',
#FORM.dist_user_id#)

</cfquery>



<cfquery datasource="distribution" name="quotes">

INSERT INTO quote ( quote_remark,
quote_from,
quote_item)

VALUES ( '#FORM.quote_remark#',
'#FORM.quote_from#',
'#FORM.quote_item#');
</cfquery>

<cflocation url="index.cfm">
</cfcase>
The database has 4 tables: quote, user, distribution_profile, picture

the relations are:
1 to many - disribution_profile to picture (distribution_id to pic_distribution_id)
1 to many - distribution_profile to quote (distribution_id to quote_distribution_id)
1 to many distribution_profile to user (dist_user_id to user_id)
jargon12 is offline   Reply With Quote
Old 12-19-2006, 03:19 PM   PM User | #2
jargon12
New to the CF scene

 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jargon12 is an unknown quantity at this point
I figured it out,

the values were sending 2 '#FORM.other_comments#', instead of one.
jargon12 is offline   Reply With Quote
Old 12-20-2006, 11:57 PM   PM User | #3
jargon12
New to the CF scene

 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jargon12 is an unknown quantity at this point
Unhappy

Another problem: Now my Access database has duplicate entries. It appears the form processes it more than once and I get duplicates
jargon12 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:41 PM.


Advertisement
Log in to turn off these ads.