| | |
Case Sensitivity
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
you have done some mistakes in the code....do the modifications as I mentioned...
in the function definition change
to the following ...
in your cmdAdd_click() change the entire code...like the following...
try this and get me your feed...
regards
Shouvik
in the function definition change
rst.Open "select * from event where eventname='" & Trim(txtEName) & "'", gcnto the following ...
rst.Open "select * from event where eventname='" & Trim(evtName) & "'", gcnin your cmdAdd_click() change the entire code...like the following...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub cmdAdd_Click() dim rst as New ADODB.Recordset on error goto chec If IsEventExists(txtEName.Text) = True Then MsgBox "Event Name Already Exist. Type a new one", vbInformation, "Duplicate Event" txtEName.SetFocus exit sub endif rst.CursorLocation = adUseClient rst.CursorType = adOpenDynamic rst.LockType = adLockOptimistic if rst.state=adstateopen then rst.close set rst=nothing rst.open "select * from event",con,1,2 rst.AddNew rst!fnumber = StrConv(txtFNumber, vbProperCase) rst!eventname = StrConv(txtEName, vbProperCase) rst!fname = StrConv(txtFName, vbProperCase) rst!fincharge = StrConv(txtFIncharge, vbProperCase) rst!fschedules = StrConv(Text2, vbProperCase) rst!fschedulee = StrConv(Text3, vbProperCase) rst!sitcapacity = StrConv(txtCapacity, vbProperCase) rst!userschede = StrConv(Combo4, vbProperCase) rst!userscheds = StrConv(Combo3, vbProperCase) rst!fuser = StrConv(txtFUser, vbProperCase) rst!destination = StrConv(txtDestination, vbProperCase) rst!condition = StrConv(cboCondition, vbProperCase) rst!enddate = dtpDate(0).Value rst!startdate = dtpDate(0).Value rst!transaction = StrConv(cboTransaction, vbProperCase) rst!fsh = StrConv(txtfsh, vbProperCase) rst!ush = StrConv(txtush, vbProperCase) rst.Update if rst.state=adstateopen then rst.close set rst=nothing Label20.Caption = "Successfully Saved. . ." Call dload2 exit sub chec: err.clear msgbox "some error occured..." txtEName.SetFocus exit sub End Sub
try this and get me your feed...
regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
•
•
•
•
Please help me how to ignore case sensitivity in VB. My program is to store data in the database, though I use small letters or big letters, the database store the data starting with a capital letter followed by small letters. Ex.
Input: Neil, neil, NEIL
In the database: Neil
So if I input Neil, the program response is ok but if I input neil or NEIL, the program results an error in the database and the program exits.
Please I need your kind help. Thank you so much.
Regards,
Neil
try formatting the data before actually submitting it to the database initially... its been a fairly long time since i've done that much with formatting text in visual basic, so i'm not really sure if there's a default way to force name style capitalization of words, but either way... you could do it like this...
vb Syntax (Toggle Plain Text)
Private Function PropperName(stDATA As String) as String 'holds returned word array, just incase ya know? Dim stWords() As String 'just a loop variable Dim iLoop As Integer 'split the submitted data into individual words, after setting 'all characters to lower case stWords = getWords(LCase(stDATA)) 'loop the words, set them the first character to upper case For iLoop = LBound(stWords) To UBound(stWords) Mid$(stWords(iLoop), 1, 1) = UCase$(Left$(stWords(iLoop), 1)) Next iLoop PropperName = Join(stWords, " ") End Function Private Function getWords(stDATA) As String() getWords = Split(stDATA, " ", , vbTextCompare) End Function
keeping in mind that the getwords isn't really needed, but if your user enters the name NEIL NORBERT - for instance - then it would submit Neil Norbert to the database, vs Neil norbert
hope that helps

[edit]
ok, so i didn't notice the vbPropperCase in StrConv before :"> but this is a good way to do it if you don't want to use the built in way - lol
[/edit]
Last edited by kain_mcbride; Jan 24th, 2009 at 9:09 pm. Reason: ... explained... :P
... there is no bug that enough coffee cannot fix...
•
•
Join Date: Aug 2008
Posts: 77
Reputation:
Solved Threads: 0
hallo friend, I have tried your code about the case sensetivity. I works great but there's a little bit problem. If I input like this:
Input1:
Event Name: Fieldtrip --------------------> (primary key)
User: Neil
Schedule: 1/20/09
Input2:
Event Name: Tour --------------------> (primary key)
User: Neil
Schedule: 1/20/09
Where the event name is my primary key in the database. It results an error if "User" and "Schedule" in input1 and input2 are the same. I was expecting that there will be no error coz my primary key is "Event Name" not the user or schedule. "some error occured..." this message will appear. But if I input another entry in input2 like:
Input2:
Event Name: Tour --------------------> (primary key)
User: James
Schedule: 1/21/09
This works fine.
Input1:
Event Name: Fieldtrip --------------------> (primary key)
User: Neil
Schedule: 1/20/09
Input2:
Event Name: Tour --------------------> (primary key)
User: Neil
Schedule: 1/20/09
Where the event name is my primary key in the database. It results an error if "User" and "Schedule" in input1 and input2 are the same. I was expecting that there will be no error coz my primary key is "Event Name" not the user or schedule. "some error occured..." this message will appear. But if I input another entry in input2 like:
Input2:
Event Name: Tour --------------------> (primary key)
User: James
Schedule: 1/21/09
This works fine.
•
•
•
•
These are the errors I see in the sample you sent to me. I was not able to view the running part. =) I will try to understand your code.
•
•
•
•
I was not able to view the running part
1. uninstall and then re-install vb
2. just register "mscomctl.ocx" and "mscomct2.ocx" in your system...
might be you are not familer with registering activex controls manually...so i'm giving you the steps :-
1. if you haven't yet messed up with vb, you will have these two ocx files in your "system32" directory of your root drive..
2. use the command --> regsvr32 <ocx file name> to register the files...like to register "mscomctl.ocx" you must type....
regsvr32 mscomctl.ocx....similarly....for the other one
regsvr32 mscomct2.ocx..........issue this command from start->run
just register these two ocx files and the errors will be simultaneously solved....
if you donot have these files...just download from net....these are freely distributable and available for download...
regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
•
•
•
•
hallo friend, I have tried your code about the case sensetivity. I works great but there's a little bit problem. If I input like this:
Input1:
Event Name: Fieldtrip --------------------> (primary key)
User: Neil
Schedule: 1/20/09
Input2:
Event Name: Tour --------------------> (primary key)
User: Neil
Schedule: 1/20/09
Where the event name is my primary key in the database. It results an error if "User" and "Schedule" in input1 and input2 are the same. I was expecting that there will be no error coz my primary key is "Event Name" not the user or schedule. "some error occured..." this message will appear. But if I input another entry in input2 like:
Input2:
Event Name: Tour --------------------> (primary key)
User: James
Schedule: 1/21/09
This works fine.
btw thanks for using the code and for urs feedback...
regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
![]() |
Similar Threads
- getting around case sensitivity. (C++)
- check case sensitive in login page (VB.NET)
- Open In New Window Php (PHP)
- website designed using PHP is case sensitive (Site Layout and Usability)
- C++ Identifiers and Keywords (C++)
- Is Select Case statement case sensitive in VB6? (Visual Basic 4 / 5 / 6)
- Windows 2000 startup probs (Windows NT / 2000 / XP)
- How to develop a new program (C++)
- We've Gone PHP! (DaniWeb Community Feedback)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How To Append Record In Flexgrid Control ( if any)
- Next Thread: Reservation System Help using VB 6
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





