By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,384 Members | 845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,384 IT Pros & Developers. It's quick & easy.

Search Entire database for String???

P: 9
Is there an easy way to search all tables using a string as search criteria.

I have started writting a heap of nested for loops, getting table defs and fields however it is becoming a little bit of a pain.

Is there some kind of select statement one might be able to write in SQL that will search all tables and all fields.

I would ideally like to go through the database searching for say 'EXT2' and then display the entire row in the table where it is located, with possibilities of more than one result.

Any ideas greatly appreaciated.
Jan 31 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 5K+
P: 8,434
I'd suggest you post this again in the Access forum. (I'm assuming it's Access you're referring to).

However, your nested-loop technique may turn out to be the best way to go. I'm not aware of any sort of all-tables or all-fields database syntax (apart from Select * of course).

It might be a good idea to fill in some more detail on your situation, though. What VB version, what database product, etc. Of course, a good generic solution would be largely independent of any specific DBMS.
Feb 1 '07 #2

100+
P: 1,646
The only thing I can think of is a union query with an OR clause for every field in each table
Feb 1 '07 #3

Expert 5K+
P: 8,434
The only thing I can think of is a union query with an OR clause for every field in each table
Yeah, but doesn't UNION insist that the fields from each table must be the same?
Feb 1 '07 #4

Expert 5K+
P: 8,434
I wonder whether automation might help. Because I notice that if you do Edit | Find while browsing an Access table, you can choose to search the field or the whole table. Perhaps automation would provide a way into this function.
Feb 1 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.