| | |
Error accessing database
Please support our ColdFusion advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2006
Posts: 2
Reputation:
Solved Threads: 0
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>
<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>
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
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
![]() |
Similar Threads
- Promoting my 2 new forums ? any ideas please ? (Promotion and Marketing Plans)
- Error Executing Database Query on server (ColdFusion)
- Error is [Microsoft][ODBC SQL Server Driver]Connection is busy (JSP)
- error due to accessing database connection using jsp (JSP)
- Error connecting to database (ASP.NET)
- Need help diplaying null values (PHP)
- Go to a new page inside an if statement (PHP)
Other Threads in the ColdFusion Forum
- Previous Thread: FrontPage Extensions and ColdFusion?
- Next Thread: Using Regex in 'Extended Find'
| Thread Tools | Search this Thread |





