Pro Visual Basic 2005For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I'm looking for a way to connect to a database server with a user supplied username/password and then searching through all the databases for a particular text string.
I know I can connect to each database individually and type sp_findtext '%<word>%' but it would be much easier to do this programmatically.
I came across some code to do this a few years ago, but can't seem to find it now.
There's actually 3 steps to this:
1. Connecting to a database server with a user name and password
2. Getting a list of all the databases connected to the server
3. Connecting to each individual database and searching for particular text.
Do you know the structure of the database ? I mean, if you knew the tables and columns, you could write a usual query for the text columns in every database/table you're interested in.
I was more looking for what was in the stored procedures. I wanted a way for it to easily connect to one database, do the search and return the results, then hit the next database and repeat the process for all databases.