Skip to main content
Participant
April 14, 2009
Question

on query for all tables and database

  • April 14, 2009
  • 1 reply
  • 414 views
 I got an complicated questions. How am i suppose to
query for ALL of the tables for all database?(Look at the uploaded
photo) Given: I got 5 database created on my desktop.


1st: db1_IWS.mdb
2nd: fun1-1.mdb
3rd: fun1-2.mdb
4th: Lardon2(LC.).mdb



The 1st database(db1_IWS.mdb) consist of 90 tables, 2nd database
(fun1-1.mdb) 1 table only but contains about 25,000 data. (i.e tables names:
310a,310b, 310c, 310d, 335v, 335w etc...) Looking at my coding below, you
can see that i'm using tables "335v" only. So how am i going to let user to
SEARCH for the rest of the files JUST by input the DOC_NO?
(*DOC_NO=txtNumberInput)



<!---Search_results.cfm--->

<CFset index="1">

     <cfquery name="get_FirstNo" datasource="DSN_db1_IWS">
      select *
      from 335v
  <cfif #txtNumberInput# is not "">
  where doc_no like <cfoutput>'%#txtNumberInput#%'</cfoutput>
       order by doc_no
  </cfif>>    
 </cfquery>


      <cfquery name="get_total" datatsource="DSN_db1_IWS">
      select count(*) as CurrentRows
      from 335v
      </cfquery>
<meta http-equiv="Contecnt-Type" content="text/html;
charset=iso-8859-1"><style type="text/css">
body {background-color=#A7EF9228bdee;
}

.style2{color:#b51111}
</style></body>
<table width....>
<tr>
<th width......>Number of files Generated:</br>
<font....><cfoutput query="get_total"><b>#get_total.CurrentRows#</cfoutput>
</tr></th></table><br>

<table width...>
<tr>
<th width.....><font...>Search Results:</font></th>
<tr>
<td width...><font....>S/N</font></td>
<td...><font....>DOC_NO</font></td>
<td...><font....>DESCRIPTION</font></td>
<td...><font....>STATUS</font></td>
<td...><font....>REMARKS</font></td>
</tr>

<cfoutput query="get_FirstNo">
<tr>
<td align=""....>
<cfScript>

         writeoutput(index);
         index=index+1;
</cfscript>
</td>
<td.....><a target="rightBottomFrame" href="../drawing
search/mainSearching.cfm?Doc_no=#get_FirstNo.doc_no#">#get_FirstNo.DOC_NO></a></font></td>
<td....><font..>#get_FirstNo.DESCRIBE#</font></td>
<td....><font..>#get_FirstNo.STATUS#</font></td>
<td....><font..>#get_FirstNo.REMARKS#</font></td>
</TR></cfoutput></table></body></html>




<!---searching.cfm--->


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Searching</title>
<meta http-equiv="Contecnt-Type" content="text/html;
charset=iso-8859-5"><style type="text/css">
body {
  background-color:#28bdee;
}
.style1{
  color: #9be094;
  font-weight: bold;
}
.style5{color:#C0D259}
.style6{color:#D1DE87}
.style7{color:#C7D76F}
</style></head>

<body class="sub"><br><br>
<font color....><span class="style5"> <span
class="style6"><strong>Document Number:</strong></span><br><br>
<form action="search_results.cfm" method="post" target="rightBottomFrame">

<font color="#FFFFFF"></font>  
<input name="txtNumberInput" type="text" size="25"
style="width:70%;"><br><br>
   
<input type="Submit" Name="btnNumber" value="Display Number"
style="width:70%;"><br><br>
<input name="btnReset" type="reset"  value="clear"
style="width:70%;"><br><br>
   <br><br></td></tr>
</table></form></body></html>
    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    April 14, 2009

    You do that by querying the system tables.

    How you query the system tables varies by database management system.