CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 [SOLVED] AutoComplete

Print topic Send  topic

Author Message
Shin

Posts: 6
Posted: 03/24/2015, 6:15 PM

Hi
I have just started to use CodeCharge for work related website. I am not really programmer so please accept if I am asking the basic questions here.

What I been doing is just modifying the current website for searching database. It seems quiet simple function. But I would like to add AutoComplete in keyword field. I used the builder and worked perfectly however the AutoComplete search with only 'Begin with'? Is there any easy way to modify so that I can used a keyword for searching in a filed regardless where it is located?

Thank you in advance.


Shin
View profile  Send private message
eratech


Posts: 513
Posted: 03/24/2015, 7:55 PM

Shin,

Look at the /service file that was created (something like /services/Record1_autocomplete.asp

It will have the query and you can change the Begins with to 'Like' or 'Contains' which will check anywhere in a field.

If the autocomplete is not working then look in the result Grid (the one showing the results of the search) as it will have a query definition (Data Source) and you can change the keyword (maybe something like 's_keyword') to be 'Contains'

I find it useful to copy the SQL query from a Grid or Report etc and paste it into your Database and run it to make sure it's getting what you expect.

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
Shin

Posts: 6
Posted: 03/24/2015, 9:14 PM

Hi Eric,

Thank you very much for quick response.
I found the SQL statement in autocomplete ASP file but I am having trouble to edit the code.
The code that I found is;

SQL = "SELECT TOP {SqlParam_endRecord} * " & vbLf & _
"FROM table {SQL_Where} {SQL_OrderBy}"
CountSQL = "SELECT COUNT(*) " & vbLf & _
"FROM table"
Where = ""
Order = ""
StaticOrder = ""

I assume that I need to put statement in Where row but I just could not figure it out how I can specify the keyword filed. I use Access database so I only can use Like statement don't I?

It would be great if I can get another advice.

Regards,

Shin
View profile  Send private message
eratech


Posts: 513
Posted: 03/25/2015, 8:09 PM

Shin - best to use the tools built into CodeCharge Studio (CCS) instead of editing the code directly. If you edit code directly:

1: you will probably get it wrong (speaking from experience); and
2: CCS will never update that code again (so future changes through CCS that affect that part of the code will NOT be updated and then you will be wondering why the code isn't working)

Open the autocomplete page and click on the 'Design' view, then click on the part of the page with the dotted lines. This is usually a 'Grid1' or similar. Look at the Properties for that Grid and see the 'DataSource' and click on the [...] button at the right-side of the property box. This will open the query builder.

It's likely that you have a 'Table' query type, so you can simply click on the 'Add WHERE condition' and put the details in that you want to select on. Note that the value passed in from the autocomplete is either 's_keyword' or 'keyword' from the URL.

Search the help manual for "Form Data Source" as it has a good overview of all the options and how to use the query builder.

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
Shin

Posts: 6
Posted: 03/25/2015, 9:32 PM

Hi Eric,

Thank you very much for your help. Finally I figured it out what I wanted. I modified the data source on query builder on AJAX Service page. It was specified as 'Begin with' so changed to 'Contains' then working perfectly.

I really appreciate your advice.

Shin :-)
View profile  Send private message
eratech


Posts: 513
Posted: 03/25/2015, 10:31 PM

No problem - glad you worked it out.

E
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.