Current location: Hot Scripts Forums » Programming Languages » Other Languages » Having all results from all tables within all my database whenever user have an input search in cfml

Having all results from all tables within all my database whenever user have an input search in cfml

Reply
  #1 (permalink)  
Old 04-14-09, 09:25 PM
alex132 alex132 is offline
New Member
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Having all results from all tables within all my database whenever user have an input search in cfml

I'm using dreamweaver coldfusion 8(cfml) with microsoft access. How am i suppose to query for ALL of the tables within ALL of the 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#">#ge t_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>
Attached Images
  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-25-09, 01:19 AM
viviotech's Avatar
viviotech viviotech is offline
Newbie Coder
 
Join Date: Jul 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Generally speaking, you can't. That's just not how SQL works. SQL is based on querying one TABLE at a time. There may be interesting ways that you can list out your tables and do some sort of join or subquery with it, but even then your search process is going to be anything BUT efficient.

Even then, that won't address your data being in multiple databases (and I use the term "database" with Access very liberally).

The "proper" way to go about this is to merge your data into ONE database, and if possible, into ONE table. Then, index your data so it can be queried efficiently. After that, your searches on such a huge amount of data may even perform respectably in Access.

Wish I had better news for you, but that's just how SQL works.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
database search skyloon PHP 3 08-19-04 12:48 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


All times are GMT -5. The time now is 06:41 AM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.