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

Querying a database

Status
Not open for further replies.

rob1

Programmer
Nov 17, 2000
1
GB
Hi, I am a beginner at Coldfusion (using Studio 4.0) and have a problem.
I have created my first database on MS Access and verified it on OBDC. I have written the following code to query it but receive a server error (161) message on my browser. Anyone have any idea why I'm getting this message? Thanks for looking anyway. (Hopefully it's something simple and dumb as I haven't been using CF long!)

Regards, Rob

Here is the code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<CFQUERY DATASOURCE=&quot;courses&quot; NAME=&quot;sales&quot; >
SELECT * FROM sales</cfquery>
<html>
<head>
<title>Sales Courses</title>
</head>

<body bgcolor=&quot;orange&quot;>
<h1> Sales Courses</h1>
<h2> We can offer the following courses at present</h2>
<CFOUTPUT QUERY=&quot;sales&quot;>
<P> Course Title: #title# </p>
<p> Course Number: #coursenumber#</p>
<p> Description: #description#</p>
<p> Duration: #duration#</p>
</cfoutput>
</body>
</html>
 
did you test the database connexion in the codfusion administrator (&quot;verify&quot;) - does it work ?
 
<!--Try this:-->


<h1> Sales Courses</h1>
<h2> We can offer the following courses at present</h2>
<CFOUTPUT QUERY=&quot;sales&quot;>
<P> Course Title: #sales.title# </p>
<p> Course Number: #sales.coursenumber#</p>
<p> Description: #sales.description#</p>
<p> Duration: #sales.duration#</p>
</cfoutput>

<!--or better and more attractive-->
<table>
<tr>
<th>title</th>
<th>coursenumber</th>
<th>description</th>
<th>duration</th>
</tr>
<cfoutput query=&quot;sales&quot;>
<tr>
<td>#sales.title#</td>
<td>#sales.coursenumber#</td>
<td>#sales.description#</td>
<td>#sales.duration#</td>
</tr>
</table>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top