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

how to make dynamic tablename

Status
Not open for further replies.

achai

MIS
May 23, 2000
71
US
I tried to set a select form, according to different value go to different table. tablename=select form value. but erro shows:'The Microsoft Jet database engine cannot find the input table or query 'DATA'. Make sure it exists and that its name is spelled correctly.&quot;<br><br>file 1:<br>&lt;form action=&quot;projectview.cfm&quot; method=&quot;post&quot;&gt; <br>&lt;select name=&quot;Projectname&quot;&gt;<br>&lt;option value=&quot;Denver_Dallas&quot; &gt;Denver_Dallas&lt;/option&gt;<br>&lt;option value=&quot;Salt_Denver&quot;&gt;SaltLake_Denver&lt;/option&gt;<br>&lt;option value=&quot;Corvis&quot;&gt;Corvis&lt;/option&gt;&lt;/select&gt;&lt;/form&gt;<br><br>file2:prjectview.cfm<br>&lt;cfSET data= #Projectname#&gt;<br>&lt;CFQUREY NAME=&quot;projectview&quot; datasource=&quot;pmc&quot;&gt;<br>Select data.ProjectID, data.CriticalIssues, data.Comments, data.UpdateDate<br>FROM DATA<br>Order by data.projectID<br>&lt;/CFQUREY&gt;<br>
 
In your example you treat 'data' as a tablename while you need to treat 'data' as a variable. Try:<br><br>&lt;CFOUTPUT&gt;<br>&lt;CFQUERY NAME=&quot;projectview&quot; DATASOURCE=&quot;pmc&quot;&gt;<br>SELECT #data#.ProjectID, #data#.CriticalIssues, #data#.Comments, #data#.Update<br>FROM #data#<br>ORDER BY #data#.ProjectID<br>&lt;/CFQUERY&gt;<br>&lt;/CFOUTPUT&gt;<br><br>this should work, good luck<br><br>Bromrrr<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top