943,834 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 2258
  • ColdFusion RSS
Feb 23rd, 2006
0

Error accessing database

Expand Post »
This is not working for some reason it is telling me that ds_products does not exist. here is the code...
<CFQUERY NAME="products" DATASOURCE="ds_products">
SELECT ProductName
FROM tblProducts
</CFQUERY>
<html>
<head>
<title></title>
</head>
<body>
<h1>Product Listing</h1>
<ul><li><CFOUTPUT QUERY="products">
#ProductName#
</CFOUTPUT></li></ul>

</body>
</html>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
krazykrisi is offline Offline
2 posts
since Feb 2006
Mar 2nd, 2006
0

Re: Error accessing database

Hey Krazykrisi,

Try this, your query is right it’s just your output

***your output was

<h1>Product Listing</h1>
<ul><li><CFOUTPUT QUERY="products">
#ProductName#
</CFOUTPUT></li></ul>

***

The mistake was here,

#ProductName#

It should have been,

# products.ProductName#

You need to include the query name with the column(s) you select within your query.
So if you were searching two things like productName and productType, their part of the output would look like

# products.productName#
# products.productType#


And if you have more than one product to display don’t forget to and a line break “<br />� after # products.ProductName#.

Good luck with everything and take care,

Walyer
Reputation Points: 10
Solved Threads: 1
Light Poster
Walyer is offline Offline
26 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: FrontPage Extensions and ColdFusion?
Next Thread in ColdFusion Forum Timeline: Using Regex in 'Extended Find'





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC