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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Executing Database Query - newbie in trouble!

Status
Not open for further replies.

baldingoldie

Technical User
Mar 26, 2007
3
GB
Hi,

This is my first attempt at this and I can't search for similar threads due to routine maintenance.

I've just come across a coldfusion 'add-on' from GotoCode.com called RegForm and thought I'd 'have a go'!

I've set the DSN in control panel and verified the ODBC connection in Coldfusion Server Administrator - says status is OK.

However, when I try to view page in browser, I get the following error message - Error Executing Database Query. Data source not found.

Can anyone point me to (hopefully step-by-step) reading?

Thanks in advance.

If it helps, I'm using DWMX 2004, ColdFusion MX, Apache, Win XP Pro

Unus est usqequaque in excrementum. Est Tantum vis ut umquam varius!
 
Where did you define the DSN? How are you calling the query?

A typical way is:
Application.cfm
<cfset myDSN = datasourcename>

page
<cfquery name="query1" datasource="#datasourcename#">
select
from
where
</cfquery>



____________________________________
Just Imagine.
 
Having turned on Robust Exception Information, it would appear that I need to become more familiar with CF 'speak'.

There is a line -

Code:
<form method="POST" action="<CFOUTPUT>#FileName#</CFOUTPUT>" name="Registration">

From the little I understand, #FileName# is a variable and 'name' is the value. Can/should the variable be a file name? Should the value be #Registration.cfm" since there is a file of that name?

Once again, if you know of any good, step-by-step tutorials you can point me to. I know there's the 'triomotors' that comes with CF but it seems such a waste of time following a tutorial that is not particularly relevant to what I am seeking to achieve.

Unus est usqequaque in excrementum. Est Tantum vis ut umquam varius!
 
In the code you posted #FileName# is the ColdFusion template that will be executed when your form is submitted. That's, probably, not relevant to the "Error Executing Database Query. Data source not found." message you are getting. It's hard to say since you are using an add-on product of some kind.

Try posting the code that sets up your query, such as the <cfquery> tag or the code that the RegForm product is being called by. Better yet, post the complete contents of your form template (i.e the .cfm file that your form is in).


Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
baldingoldie, well the only place you'd get a step-by-step tutorial is from the company (that created the add-in) itself; or someone that used this and had the time to write one up.

As for:
Code:
<form method="POST" action="<CFOUTPUT>#FileName#</CFOUTPUT>" name="Registration">

You need to:
1) find out where the variable #FileName# is defined, and what its value is. The value *must* be a file name because its being used in an form action attribute (file name could be .cfm, .asp, .do, or whatever)

2) the name="Registration" is just the name of the form.

Post the code/query that causes the error. if its too much to post here, then post a URL so we can look at it. Try wrapping the <cfquery> or code in <cftry><cfcatch> to see what exactly the error says. The <cfcatch> dumps out very specific error messages that helps debug 10x easier.

An example of a <cftry><cfcatch> is:
Code:
<cftry>
	<cfquery>
	...
	</cfquery>
	
	other cf code...
	
	or other queries
	<cfcatch type="any"><cfdump var="#cfcatch#" label="error"><cfabort></cfcatch>
</cftry>
The above will dump out all debuggins info needed to trouble-shoot and abort the page so further (if any) processing does not occur.

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top