Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote view parameter + '%'
Message
From
06/11/2002 17:23:26
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
 
 
To
05/06/2002 13:08:35
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00665048
Message ID:
00719609
Views:
20
This is an old thread, but I just found out that my problem was caused by a backwards compatibility setting in SQL Server. See sp_dbcmptlevel in T-SQL help if you find empty strings are being converted to spaces when concatenated.

>Hello everyone,
>
>About year ago or so , I set up a name search view that looked sorta like this:
>
>Local View:
Select * from People where LastName = ?cLastName and FirstName = ?cFirstName
>Remote View:
Select * from People where LastName Like ?cLastName+'%' and FirstName Like ?cFirstName+'%'
>
>The intent was to provide search capability with only partial names, while not hard-coding percent signs (%) for remote views. To see everyone whose last name started with "S", I would simply set the cLastName variable to 'S'. To my recollection, this used to work as expected on both local and remote views. Now, if I set cFirstName to an empty value (''), the remote view only returns records with an empty FirstName field. If I set cFirstName to '%', then it does work as expected, but as I said earlier, I'm trying to avoid doing that in code. Evidently, SQL Server sees FirstName=''+'%' differently than FirstName='%'. Is there a SQL Server setting somewhere that would affect this? I would probably just use the LIKE keyword in the Local View and put the '%' in code, but our framework is expecting the view to be in the format above.
>
>We are currently using SQL Server 7 Standard version with the latest service pack. Previously, I was using the Desktop version, and probably with an older service pack. Maybe it is my memory that is defective <g>, but an indication either way would be appreciated.
>
>Thanks.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Previous
Reply
Map
View

Click here to load this message in the networking platform