Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fieldname Not Found 1

Status
Not open for further replies.

metaphiz

Programmer
Jun 30, 2004
91
US
I'm getting the error:

The given fieldname "MAILING" could not be found in the table "Users".

Even though 'mailing' is definitely a field in the table. What could cause the misidentification? Do datatypes affect it? The Mailing form field is a checkbox and it's inserting it into a 'yes/no' field in Access.

I'm trying to insert, and I've used the SQL insert as well as <cfinsert>.
 
Don't use cfinsert... Simply because you should be used to having more control over your queries than a wizard can provide.

Datatypes do not affect it... Try this...

Add a column to your table... temporarily and then run this script.

Code:
<cfquery name="fnTest" datasource="...">
  select * from MYTABLEHERE
   where 1 = 0
</cfquery>

<cfoutput>#fnTest.columnlist#</cfoutput>

Se what's listed there.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Hey Thanks. The Columlist thing...what do u call it, a 'scope'? is a new trick that may come in handy down the road.

Aaaaaaaaaaaaarrrrrrrrrrrgh. Located the problem and I'm a bit embarrased it's so elementary. I must've been pulling my hair out for 3 hours over this. I HAD THE WRONG DATASOURCE! Was querying the wrong table duh.
 
I did the wrong datasource thing once... well kinda... Access was... caching my database... when I tried to open it, all I got was the same thing over and over.

Columnlist is just a gift from the good people of Macromedia... heh... it tells you all the select fields from a query... Form has fieldnames ... literally form.fieldnames.. whereas with columnlist its QUERY_NAME.columnlist.

And you're welcome.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top