Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,788| Members 17,820, Newest waheguruhelpme| Online 211
Home Contact
 (Forgotten?): 
    A portrait by Bhagat Singh of Sikhiart.com

   
                                                                     Your Banner Here!    

Force Lower Case

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
How do I get Access to differentiate capital and lower case letter SteveEdge Information Technology 2 28-Jul-2006 08:31 AM
Upper and Lower case conversion issues perryclisbee via AccessMonster.com Information Technology 2 28-Jul-2006 08:26 AM
How Can I Set A Text Field To Only Allow Caps, Not Lower Case? bill60 Information Technology 1 17-Nov-2005 18:02 PM
RE: How Can I Set A Text Field To Only Allow Caps, Not Lower Case? xRoachx Information Technology 0 17-Nov-2005 18:02 PM
RE: How Can I Set A Text Field To Only Allow Caps, Not Lower Case? Ofer Information Technology 0 17-Nov-2005 18:02 PM


Tags
force, lower, case
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:17 AM
Paperback Writer's Avatar Paperback Writer
Guest
 
Posts: n/a
   
   
Force Lower Case

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I am going to construct a table from a multitude of sources. Once done, all
my letters must be lower case (the dumb program receiving this file will
misinterpret upper case letters).

How do I make an Access table with all lower case letters?
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/10999-force-lower-case.html

*








 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:17 AM
Steve Schapel's Avatar Steve Schapel
Guest
 
Posts: n/a
   
   
Re: Force Lower Case

Paperback,

Run an Update Query on the table, update all applicable fields to...
StrConv([NameOfField],2)

--
Steve Schapel, Microsoft Access MVP

Paperback Writer wrote:
> I am going to construct a table from a multitude of sources. Once done, all
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10999
> my letters must be lower case (the dumb program receiving this file will
> misinterpret upper case letters).
>
> How do I make an Access table with all lower case letters?

Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:17 AM
Joseph Meehan's Avatar Joseph Meehan
Guest
 
Posts: n/a
   
   
Re: Force Lower Case

Paperback Writer wrote:
> I am going to construct a table from a multitude of sources. Once
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10999
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10999
> done, all my letters must be lower case (the dumb program receiving
> this file will misinterpret upper case letters).
>
> How do I make an Access table with all lower case letters?


You can create custom text and memo formats by using the following symbols.
SymbolDescription
@ Text character (either a character or a space) is required.
& Text character is not required.
< Force all characters to lowercase.
> Force all characters to uppercase.



--
Joseph Meehan

Dia duit


Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:17 AM
Jamie Collins's Avatar Jamie Collins
Guest
 
Posts: n/a
   
   
Re: Force Lower Case

  Donate Today!  

Paperback Writer wrote:

> How do I make an Access table with all lower case letters?


As I always say, if you have a data rule such as only lowercase letters
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10999
are allowed then there should be a constraint (Validation Rule) in the
database to enforce the rule.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10999

This is a tricky one because the engine in this regard is
case-insensitive e.g.

SELECT *
FROM MyTable
WHERE 'a' = 'A';

The expression 'a' = 'A' is true.

One way around this is to test the character code using the ASC()
function e.g.

SELECT *
FROM MyTable
WHERE ASC('a') = ASC('A');

The expression ASC('a') = ASC('A') is equivalent to 97 = 65 and is
false.

We can parse out the individual letters using a Sequence table, a
standard auxiliary table of integers e.g.

CREATE TABLE [Sequence]
(seq INTEGER NOT NULL PRIMARY KEY)
;
INSERT INTO [SEQUENCE] (seq) VALUES (1)
;
INSERT INTO [SEQUENCE] (seq) VALUES (2)
;
INSERT INTO [SEQUENCE] (seq) VALUES (3)
;

Let's keep things simple and assume the OP's column to test for
lowercase letters is fixed width three characters:

CREATE TABLE Test3 (
data_col CHAR(3) NOT NULL)
;
INSERT INTO Test3 (data_col) VALUES ('UP ')
;
INSERT INTO Test3 (data_col) VALUES ('UPP')
;
INSERT INTO Test3 (data_col) VALUES ('Mix')
;
INSERT INTO Test3 (data_col) VALUES ('lo ')
;
INSERT INTO Test3 (data_col) VALUES ('low')
;

Obviously, only the last row inserted should pass the rule 'lowercase
letters only'.

Here's the SQL to parse the letters:

SELECT T1.data_col,
S1.seq AS letter_pos,
MID$(T1.data_col, S1.seq, 1) AS letter,
ASC(MID$(T1.data_col, S1.seq, 1)) AS letter_code
FROM Test3 AS T1,
[Sequence] AS S1;

We can use the letter code in a subquery to identify the rows that pass
the rule 'lowercase letters only':

SELECT data_col
FROM Test3
WHERE NOT EXISTS (
SELECT *
FROM Test3 AS T1,
[Sequence] AS S1
WHERE Test3.data_col = T1.data_col
AND
ASC(MID$(T1.data_col, S1.seq, 1))
NOT BETWEEN ASC('a') AND ASC('z')
);

To show the rows that fail the rule, change the NOT EXISTS clause to
EXISTS. However, the construct that show the rows that pass the rule is
ultimately more useful because we can use the assertion in a CHECK
constraint:

DROP TABLE Test3
;
CREATE TABLE Test3 (
data_col NCHAR(3) NOT NULL,
CONSTRAINT Test3__data_col__lowercase_letters_only
CHECK (
NOT EXISTS (
SELECT *
FROM Test3 AS T1,
[Sequence] AS S1
WHERE Test3.data_col = T1.data_col
AND
ASC(MID$(T1.data_col, S1.seq, 1))
NOT BETWEEN ASC('a') AND ASC('z')
)
)
)
;
INSERT INTO Test3 (data_col) VALUES ('UP ')
;
INSERT INTO Test3 (data_col) VALUES ('UPP')
;
INSERT INTO Test3 (data_col) VALUES ('Mix')
;
INSERT INTO Test3 (data_col) VALUES ('lo ')
;
INSERT INTO Test3 (data_col) VALUES ('low')
;

This time, all the inserts fail except the last.

As is my usual courtesy, here's some VBA code to recreate and
demonstrate the above scenario:

Sub QueryCheck()
Dim cat As Object
Set cat = CreateObject("ADOX.Catalog")
With cat
.Create _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\DropMe.mdb"
With .ActiveConnection
.Execute _
"CREATE TABLE Test2 ( data_col CHAR(3)" & _
" NOT NULL);"
.Execute _
"INSERT INTO Test2 (data_col)" & _
" VALUES ('UP ');"
.Execute _
"INSERT INTO Test2 (data_col)" & _
" VALUES ('UPP');"
.Execute _
"INSERT INTO Test2 (data_col)" & _
" VALUES ('Mix');"
.Execute _
"INSERT INTO Test2 (data_col)" & _
" VALUES ('lo ');"
.Execute _
"INSERT INTO Test2 (data_col)" & _
" VALUES ('low');"

.Execute _
"CREATE TABLE [Sequence] (seq INTEGER" & _
" NOT NULL PRIMARY KEY);"
.Execute _
"INSERT INTO [Sequence] (seq)" & _
" VALUES (1);"
.Execute _
"INSERT INTO [Sequence] (seq)" & _
" VALUES (2);"
.Execute _
"INSERT INTO [Sequence] (seq)" & _
" VALUES (3);"

Dim rs As Object
Set rs = .Execute( _
"SELECT T1.data_col, S1.seq AS letter_pos," & _
" MID$(T1.data_col, S1.seq, 1) AS letter," & _
" ASC(MID$(T1.data_col, S1.seq, 1))" & _
" AS letter_code" & _
" FROM Test2 AS T1, [Sequence] AS S1;")
MsgBox rs.GetString
rs.Close

.Execute _
"CREATE TABLE Test3 ( data_col NCHAR(3) NOT" & _
" NULL, CONSTRAINT Test3__data_col__" & _
"lowercase_letters_only" & _
" CHECK ( NOT EXISTS ( SELECT * FROM Test3" & _
" AS T1, [Sequence] AS S1 WHERE Test3.data_col" & _
" = T1.data_col AND ASC(MID$(T1.data_col," & _
" S1.seq, 1)) NOT BETWEEN ASC('a') AND ASC('z')" & _
" )));"

Dim lRows As Long
Dim data_value As String * 3

data_value = "UP "
lRows = 0
On Error Resume Next
.Execute _
"INSERT INTO Test3 (data_col)" & _
" VALUES ('" & data_value & "');", lRows
MsgBox _
"Attempt to insert " & _
"'" & data_value & "'" & vbCr & vbCr & _
"Error: " & _
IIf(Len(Err.Description) = 0, "(none)", _
Err.Description) & vbCr & vbCr & _
"Rows affected: " & CStr(lRows)
On Error GoTo 0

data_value = "UPP"
lRows = 0
On Error Resume Next
.Execute _
"INSERT INTO Test3 (data_col)" & _
" VALUES ('" & data_value & "');", lRows
MsgBox _
"Attempt to insert " & _
"'" & data_value & "'" & vbCr & vbCr & _
"Error: " & _
IIf(Len(Err.Description) = 0, "(none)", _
Err.Description) & vbCr & vbCr & _
"Rows affected: " & CStr(lRows)
On Error GoTo 0

data_value = "Mix"
lRows = 0
On Error Resume Next
.Execute _
"INSERT INTO Test3 (data_col)" & _
" VALUES ('" & data_value & "');", lRows
MsgBox _
"Attempt to insert " & _
"'" & data_value & "'" & vbCr & vbCr & _
"Error: " & _
IIf(Len(Err.Description) = 0, "(none)", _
Err.Description) & vbCr & vbCr & _
"Rows affected: " & CStr(lRows)
On Error GoTo 0

data_value = "Lo "
lRows = 0
On Error Resume Next
.Execute _
"INSERT INTO Test3 (data_col)" & _
" VALUES ('" & data_value & "');", lRows
MsgBox _
"Attempt to insert " & _
"'" & data_value & "'" & vbCr & vbCr & _
"Error: " & _
IIf(Len(Err.Description) = 0, "(none)", _
Err.Description) & vbCr & vbCr & _
"Rows affected: " & CStr(lRows)
On Error GoTo 0

data_value = "low"
lRows = 0
On Error Resume Next
.Execute _
"INSERT INTO Test3 (data_col)" & _
" VALUES ('" & data_value & "');", lRows
MsgBox _
"Attempt to insert " & _
"'" & data_value & "'" & vbCr & vbCr & _
"Error: " & _
IIf(Len(Err.Description) = 0, "(none)", _
Err.Description) & vbCr & vbCr & _
"Rows affected: " & CStr(lRows)
On Error GoTo 0

End With
Set .ActiveConnection = Nothing
End With
End Sub

A subquery in a CHECK constraint is a very powerful feature of Jet,
more powerful that its big sister SQL Server which has not implemented
the same functionality six years on. Yet, this Jet functionality is
seemingly very little used. Anyone know why this feature remains
neglected?

Jamie.

--

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 06:52 AM
21 Replies, 319 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 72 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 45 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 112 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,833 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 225 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 39 Views
sikhism How important is Matha...
By Ishna
Yesterday 19:05 PM
58 Replies, 1,026 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 62 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 43 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 45 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 408 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 46 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 07:11 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.58237 seconds with 30 queries