|
-
Oct 11th, 2001, 02:25 PM
#1
Thread Starter
Junior Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|