LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Search a database with multiple strings?

The last code I posted had the following:

"Initial Catalog='Northwind';Integrated Security='SSPI';"

Inital Catalog and Integrated Security are two columns in the database.

In your database you have two columns "Permit Number" and "Engineer". Your
want

SQL = "Permit Number = '1234';Engineer = 'Lawson & Lawson Engineers, LLC'"



Now if you want to make the line variable do this

PNum = 1234
Eng = Lawson & Lawson Engineers, LLC

Then

SQL = "Permit Number = '" & PNum & "';Engineer = '" & Eng &"'"

The above line has the following in order

" - a single quote
'" - a single quote followed by a double quote
"' - a double quote followed by a single quote
'" - a single quote followed by a double quote
"'" - a double quote, single quote, and then another double quote


I hope this gets you a little futher along
"gab1972" wrote:

I really hate to be a pain...

I understand that the last bit of code gives me a connection to access
from Excel using ADO....what part is allowing me to search?

Right now, I'm only giving the option to search by permit number. The
user selects a permit number from a combobox and based on that value,
Excel is going to Access, finding the corresponding recordset and
bringing it back to Excel. What I want is to expand my search
string. So instead of limiting to a permit number...say the permit
was applied for in Sumter County (one of the counties in my state) and
the engineer was Lawson & Lawson Engineers, LLC. I want my user to be
able to type in "Sumter, Lawson" in a box and have Excel find all
recordsets in my data table matching those criteria. There might be 4
recordsets matching Sumter County and Lawson & Lawson Engineers, LLC,
but each with different permit numbers. This gives the user a bit
more flexibility in narrowing down their search if they don't know the
specific permit number.

Again, I *REALLY* appreciate all your help...I hope I'm not
frustrating you with all the questions.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
search for multiple strings Lea from CA[_2_] Excel Discussion (Misc queries) 4 October 16th 09 10:20 PM
Search for multiple strings in a list (w/in 1 cell) w/ Advanced fi Maher Excel Discussion (Misc queries) 5 July 7th 08 06:02 PM
Search multiple strings in one text file flaterp Excel Programming 4 February 4th 08 07:06 PM
Search multiple strings in each cell Dave Peterson Excel Programming 7 December 18th 06 06:05 PM
Search multiple strings Difficult to figure out Jeff Excel Programming 2 November 23rd 06 04:18 AM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"