Parsing Strings to use in SQL commands
What I am trying to do is show the user database information formatted all nice and pretty in a list box, and when the user clicks on one of the list items, I would like to have the string displayed in the list item parsed out using the Split( ) function and then used in an SQL statement to find the record they selected.
I can get the string parsed out using Split( ) into an array, but how could I then query the database on this string? For instance, could I use 'SELECT * FROM TABLENAME WHERE COLUMNAME = 'stringArray(0)' or something similar to this and just iterate through the stringArray( )?
I know the items in the List Box will be ordered in a certain way so that each time Split( ) is called I will at least know what the very last item is. What is giving me problems, is sometimes there will be blanks. For example, in the first row of the List Box, there will be items such as Name, Address, Phone Number, . . . . , Email, etc. Sometimes some of the items will be blank.
Could I just use 'SELECT * FROM TABLENAME WHERE * = 'stringArray( )', so that I get a constantly smaller recordset returned each time?
Any ideas or thoughts would be appreciated, because has been bugging me for the past few days.
Sorry about the confusion
Let me explain, no there is too much, let me summarize.
What I would like to know is how you could search a database by set of tokens that you get by using Split( ). I have a space delimited string that can differ in the number of tokens. I would like to be able to search a DAO database using these tokens in an SQL statement.
What I would like to know is if the number of tokens can differ in each string, is there any way to have an SQL statement filter all of the possible combinations of these tokens to return the record set associated with that string?
I guess in other words, I would like to sort out the particular recordset based on the tokens provided by the string chosen.
I hope this helps.