Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
Thread: searching a whole database
02-24-2006, 09:41 AM #1
searching a whole database
hi, i would liek to know if it is possible to search a hole database in asp, every table basically, thanks in advance
02-25-2006, 07:08 AM #2
02-25-2006, 11:32 AM #3
I don't think you can search for the whole database but you can always search for each table and save the results with arrays.
Code:Dim x, i i = 0 For x = 1 to NumOfTablesInDatbase SQL = "SELECT * FROM table" & x & " WHERE (condition)" While not rs.eof ArrayName(i) = rs("name") ArrayId(i) = rs("id") Array("type") = rs("type") 'etc etc i = i + 1 rs.movenext Wend Next
02-26-2006, 12:59 AM #4
im not that pro of a coder lol.. thanks anyways
02-26-2006, 01:04 AM #5
- Join Date
- May 2005
- Michigan, USA
- Thanked 0 Times in 0 Posts
You can also get a list of tables in the DB by using the system tables.
Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.
03-07-2006, 03:26 AM #6
- Join Date
- Aug 2002
- Thanked 2 Times in 2 Posts
And of course if the fields are structured the same you could put a bunch of SQL statements together with UNION.
And for a related link (although it only uses one table):
Classic ASP Design Tips - Search For Keywords on Multiple Fields