CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 case insensitive using upper()

Print topic Send  topic

Author Message
dmk

Posts: 1
Posted: 04/03/2005, 10:00 PM

Hi,

I'm new to CCS (started tonight). I see that the solution for searching on a field so that case doesn't matter is to use the upper function.

My question is...what steps do I take to get to the place where I should put upper. I've been reading some postings and it seems like maybe I should access this through Editable Grid Builder and select custom?

If someone would be so kind, can you please explain the steps in greater detail. We're trying to finish this website by tomorrow morning.

Thanks!

Thanks.
View profile  Send private message
peterr


Posts: 5971
Posted: 04/03/2005, 10:18 PM

You may not need to do anything in CCS or your Web application, depending on the database you're using. Just setup proper indexing/sort order/colation in your database.
See:
http://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm
http://www.google.com/search?hl=en&q=case+insensitive+search+sql

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Ganesan

Posts: 25
Posted: 07/08/2005, 3:03 AM

Hi,
If you need case in sensitive search, do the following in your classes.php in your web folder.
find the case statments in function Operation(.......)
case opBeginsWith:
$Result = $FieldName . " like '" . $SQLValue . "%'";
break;
case opNotBeginsWith:
$Result = $FieldName . " not like '" . $SQLValue . "%'";
break;
case opEndsWith:
$Result = $FieldName . " like '%" . $SQLValue . "'";
break;
case opNotEndsWith:
$Result = $FieldName . " not like '%" . $SQLValue . "'";
break;
case opContains:
$Result = $FieldName . " like '%" . $SQLValue . "%'";
break;
case opNotContains:
$Result = $FieldName . " not like '%" . $SQLValue . "%'";
break;

Change the above lines into the following:

case opBeginsWith:
$Result = "UPPER(" . $FieldName . ") like '" . strtoupper($SQLValue) . "%'";
break;
case opNotBeginsWith:
$Result = "UPPER(" . $FieldName . ") not like '" . strtoupper($SQLValue) . "%'";
break;
case opEndsWith:
$Result = "UPPER(". $FieldName . ") like '%" . strtoupper($SQLValue) . "'";
break;
case opNotEndsWith:
$Result = "UPPER(" . $FieldName . ") not like '%" . strtoupper($SQLValue) . "'";
break;
case opContains:
$Result = "UPPER(" . $FieldName . ") like '%" . strtoupper($SQLValue) . "%'";
break;
case opNotContains:
$Result = "UPPER(" . $FieldName . ") not like '%" . strtoupper($SQLValue) . "%'";
break;

Save and try any of your search builder, it will work.
(I'm using PHP. If you are using ASP, use UCASE insteadof strtoupper)
Regards,
Ganesan
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.