Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8874067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:37:42+00:00 2026-06-14T18:37:42+00:00

I am writing my first ColdFusion component but I am getting this error. Does

  • 0

I am writing my first ColdFusion component but I am getting this error. Does anyone have an idea what this means?

Invalid CFML construct found on line 2 at column 1.
ColdFusion was looking at the following text:
<
The CFML compiler was processing:
< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?
The error occurred in C:/inetpub/wwwroot/ColdFusion/test.cfm
<cfcomponent displayname="News" hint="Get News">
<cffunction name="GetNews" returntype="query">
<cfquery datasource="CFDatabase" name="myQuery"

The source code:

<cfcomponent displayname="News" hint="Get News">
<cffunction name="GetNews" returntype="query">
    <cfquery datasource="CFDatabase" name="myQuery">
        select * from tbNews
    </cfquery>
    <cfreturn myQuery>
</cffunction>
</cfcomponent>

<cfinvoke component="components.News" method="GetNews" returnvariable="AllNews">

<table width="100%">
<cfoutput query="AllNews">
<tr>
    <td>Title:</td>
    <td><cfoutput>#myQuery.Title#</cfoutput></td>
    <td>Body:</td>
    <td><cfoutput>#myQuery.Description#</cfoutput></td>
</tr>
</cfoutput>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:37:43+00:00Added an answer on June 14, 2026 at 6:37 pm

    You’ve placed the <cfcomponent> inside a cfm file, this i not allowed.

    move the <cfcomponent> block to a file with a .cfc extension (eg News.cfc), then call it from your .cfm file

    in News.cfc

    <cfcomponent>
    <cffunction name="getNews">
    ...
    </cffunction>
    </cfcomponent>
    

    in test.cfm

    <cfset newsObj = createobject('component', 'News')>
    <cfset AllNews = newsObj.getNews()>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing my first FireFox extension and I have some questions. Maybe someone
I'm writing my first Android application and I have one activity that I'd like
I am writing my first little Access 2003 application. I have two queries that
Recently I have been writing parameterized queries like this: SQL = INSERT INTO myTable
I´m writing my first programs in Perl, and wrote this: use strict; use warnings;
I am writing an app and I have run into a problem. The first
When writing a function I always have this confusion whether to check for errors
I just started writing my first Yii application, but my AR class doesn't seem
Writing my first C# application...never touched the language before and not much of a
I'm writing my first Rails app and I'm confused by a method call that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.