Gary Gordon
|
| Posted: 04/05/2005, 9:53 PM |
|
I am new to CCS. I was successful in creating a search that displays the results from an .mdb file. There's about 5 columns in the table. (Category, Sub Category, Description, Model and Price)
I want to have a single TEXT BOX for the user to enter their information into which will search the database. (This is fine and I've been able to do this using the CCS interface.)
But what I want to do .. is have the user select from a drop down menu .. or radio buttons .. which column they want to search through (with the word or words they enter).
So, if I enter the word "Sony" (for example), I don't want to search all 5 columns for the existence of the word Sony. I may only want to search the Description column for the word Sony.
How can I (if possible) .. use the interface of CCS to create this .. so when the user enters their information into the TEXT BOX, .. that before they click on the SUBMIT button, they would select (ALL FIELDS, CATEGORY, SUB CATEGORY, DESCRIPTION, MODEL or PRICE) from a drop down menu or using radio buttons, or checkboxes. Then, the keyword (s) that they enter would search through the selected field(s) only.
Can you help?
Thanks,
Gary
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 04/05/2005, 11:57 PM |
|
You wrote that you're new to CCS, but I'm not sure how experienced are you with the SQL. If you can write complex WHERE starements then this shouldn't be too difficult, as most likely you would need to be able to write an SQL WHERE statement to handle this.
Start with creating simple SQL for your data source, like
"SELECT * FROM some_table WHERE category_id={s_category}"
and create the data source parameter "s_category".
Possibly this document can help: http://docs.codecharge.com/studio/html/UserGuide/Forms/FormDataSource.html
Once you get the above working and understand how it works then I or someone else may be able to provide more info. I just wouldn't want to confuse you if you wouldn't understand the above.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Gary Gordon
|
| Posted: 04/06/2005, 10:00 AM |
|
Peter,
I appreciate you asking if I have experience with SQL.
Basically, I have a very basic understanding of it .. but no experience in working with it.
So, .. I was kind of hoping that it might just be something I could do using the application (and just selecting certain things to have it display). If so, please let me know.
If not .. and if you don't mind .. I could really use some hand holding and some explanatiion of how to do this and set it up.
Additionally, I saw in the CSS Example Pack .. there was an item titled "MultiSelectSearch" and even though this uses a multi-select field .. it is close to what I wanted. I wanted to use checkboxes and/or a drop down menu for each item instead of a multiselect field. So this is close.
But I wasn't sure how I could take the MultiSelectSearch .. and move it out of the example pack so I could use it as a stand alone project.
Can you help me with this .. and if so .. should I continue to post all my questions here .. or in an email (through support), or what? Please let me know.
Thanks for your help,
Gary
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 04/06/2005, 4:53 PM |
|
I can only provide a few basic tips here as what you described could be quite time consuming, especially when using multi-select listbox/checkboxes. It could be easier if you use radio button and allow only one selection.
If no one else provides detailed help for you then you may want to request help in our Help/Consulting forums, or from YesSoftware. Otherwise possibly try playing with the Data Source until you figure out how to work with the SQL and parameters.
In general tems to implement a simple one-field search (s_keyword) and allow users to specify in one chekbox (s_checkbox) if they want to search that field; you'd need to use in your grid an SQL statement like:
SELECT * FROM some_table WHERE ({s_checkbox}<>0 AND some_field LIKE "%{s_keyword}%
Then create SQL parameters for both s_checkbox and s_keyword.
If you can make this work then you should be able to expand the above SQL to work with multiple fields.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|