Senin, 20 Oktober 2014

Re: [MS_AccessPros] Re: upating names with capitalisation

 

Onno-


Use StrComp:

If StrComp(oldname, newname, vbBinaryCompare) <> 0 Then


StrComp returns -1 if old is less than new, 0 if equal, and 1 if old is greater than new.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 20, 2014, at 3:54 PM, onno.knol@pbl.nl [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Ah ...

An update to this question...  probably the cause is a test  that I do before I issue the sql:

I test the old and the new name for differences

So my test is:

 

 If newname <> oldname then  ... (update)

 

but  ...  if oldname= 'good' and newname = 'Good'  these are considered the same.

I could change the default compare setting for the whole database to Option compare binary

but this is not desired in other situations.

 

What is the best way to do a case-sensitive string comparison?

 

Onno


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar